fix: test case for delete workspace

This commit is contained in:
alt0
2023-01-09 17:04:31 +08:00
parent 3e9304fb05
commit f7ff8f29b8
@@ -48,10 +48,13 @@ test.describe.serial('local provider', () => {
expect(workspaces.workspaces.length).toEqual(1); expect(workspaces.workspaces.length).toEqual(1);
/** /**
* FIXME * FIXME
* Running following code will crash the worker, and get error like next line: * If we don't wrap setTimeout,
* Running deleteWorkspace will crash the worker, and get error like next line:
* InvalidStateError: An operation was called on an object on which it is not allowed or at a time when it is not allowed. Also occurs if a request is made on a source object that has been deleted or removed. Use TransactionInactiveError or ReadOnlyError when possible, as they are more specific variations of InvalidStateError. * InvalidStateError: An operation was called on an object on which it is not allowed or at a time when it is not allowed. Also occurs if a request is made on a source object that has been deleted or removed. Use TransactionInactiveError or ReadOnlyError when possible, as they are more specific variations of InvalidStateError.
* */ * */
// await provider.deleteWorkspace(workspaces.workspaces[0].id); setTimeout(async () => {
// expect(workspaces.workspaces.length).toEqual(0); await provider.deleteWorkspace(workspaces.workspaces[0].id);
expect(workspaces.workspaces.length).toEqual(0);
}, 10);
}); });
}); });