fix private constructor problem
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -345,11 +345,13 @@ Options:
|
||||
-i, --runInBand
|
||||
--runTestsByPath
|
||||
--runner
|
||||
--seed
|
||||
--selectProjects
|
||||
--setupFiles
|
||||
--setupFilesAfterEnv
|
||||
--shard
|
||||
--showConfig
|
||||
--showSeed
|
||||
--silent
|
||||
--skipFilter
|
||||
--snapshotSerializers
|
||||
@@ -524,11 +526,13 @@ Options:
|
||||
-i, --runInBand
|
||||
--runTestsByPath
|
||||
--runner
|
||||
--seed
|
||||
--selectProjects
|
||||
--setupFiles
|
||||
--setupFilesAfterEnv
|
||||
--shard
|
||||
--showConfig
|
||||
--showSeed
|
||||
--silent
|
||||
--skipFilter
|
||||
--snapshotSerializers
|
||||
|
||||
@@ -50,7 +50,9 @@ describe('StorageTaskBroker', () => {
|
||||
it('should claim a dispatched work item', async () => {
|
||||
const broker = new StorageTaskBroker(storage, logger);
|
||||
await broker.dispatch({ spec: {} as TaskSpec });
|
||||
await expect(broker.claim()).resolves.toEqual(expect.any(TaskManager));
|
||||
await expect(broker.claim()).resolves.toEqual(
|
||||
expect.any(TaskManager as any),
|
||||
);
|
||||
});
|
||||
|
||||
it('should wait for a dispatched work item', async () => {
|
||||
@@ -60,7 +62,7 @@ describe('StorageTaskBroker', () => {
|
||||
await expect(Promise.race([promise, 'waiting'])).resolves.toBe('waiting');
|
||||
|
||||
await broker.dispatch({ spec: {} as TaskSpec });
|
||||
await expect(promise).resolves.toEqual(expect.any(TaskManager));
|
||||
await expect(promise).resolves.toEqual(expect.any(TaskManager as any));
|
||||
});
|
||||
|
||||
it('should dispatch multiple items and claim them in order', async () => {
|
||||
@@ -72,9 +74,9 @@ describe('StorageTaskBroker', () => {
|
||||
const taskA = await broker.claim();
|
||||
const taskB = await broker.claim();
|
||||
const taskC = await broker.claim();
|
||||
await expect(taskA).toEqual(expect.any(TaskManager));
|
||||
await expect(taskB).toEqual(expect.any(TaskManager));
|
||||
await expect(taskC).toEqual(expect.any(TaskManager));
|
||||
await expect(taskA).toEqual(expect.any(TaskManager as any));
|
||||
await expect(taskB).toEqual(expect.any(TaskManager as any));
|
||||
await expect(taskC).toEqual(expect.any(TaskManager as any));
|
||||
await expect(taskA.spec.steps[0].id).toBe('a');
|
||||
await expect(taskB.spec.steps[0].id).toBe('b');
|
||||
await expect(taskC.spec.steps[0].id).toBe('c');
|
||||
|
||||
Reference in New Issue
Block a user