Skip to content

Commit 584ad0f

Browse files
committed
test: fix latest wrong commit
1 parent c94a5ca commit 584ad0f

1 file changed

Lines changed: 2 additions & 147 deletions

File tree

packages/verrou/src/test_suite.ts

Lines changed: 2 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="@japa/assert" />
22

3-
import { type Group } from '@japa/runner/core'
3+
import type { Group } from '@japa/runner/core'
44
import type { test as JapaTest } from '@japa/runner'
55
import { setTimeout as sleep } from 'node:timers/promises'
66

@@ -136,7 +136,6 @@ export function registerStoreTestSuite<T extends { new (options: any): LockStore
136136
lock.run(async () => {
137137
await sleep(500)
138138
flag = true
139-
console.log('runned')
140139
})
141140

142141
assert.isFalse(flag)
@@ -150,134 +149,6 @@ export function registerStoreTestSuite<T extends { new (options: any): LockStore
150149
assert.equal(result, '42')
151150
})
152151

153-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
154-
const provider = new LockFactory(new store(config))
155-
const lock = provider.createLock('foo')
156-
let flag = false
157-
158-
await lock
159-
.run(async () => {
160-
flag = true
161-
throw new Error('hello world')
162-
})
163-
.catch(() => undefined)
164-
165-
assert.isTrue(flag)
166-
await lock.run(async () => undefined)
167-
}).pin()
168-
169-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
170-
const provider = new LockFactory(new store(config))
171-
const lock = provider.createLock('foo')
172-
let flag = false
173-
174-
await lock
175-
.run(async () => {
176-
flag = true
177-
throw new Error('hello world')
178-
})
179-
.catch(() => undefined)
180-
181-
await lock.run(async () => undefined)
182-
assert.isTrue(flag)
183-
}).pin()
184-
185-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
186-
const provider = new LockFactory(new store(config))
187-
const lock = provider.createLock('foo')
188-
let flag = false
189-
190-
await lock
191-
.run(async () => {
192-
flag = true
193-
throw new Error('hello world')
194-
})
195-
.catch(() => undefined)
196-
197-
await lock.run(async () => undefined)
198-
assert.isTrue(flag)
199-
}).pin()
200-
201-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
202-
const provider = new LockFactory(new store(config))
203-
const lock = provider.createLock('foo')
204-
let flag = false
205-
206-
await lock
207-
.run(async () => {
208-
flag = true
209-
throw new Error('hello world')
210-
})
211-
.catch(() => undefined)
212-
213-
await lock.run(async () => undefined)
214-
assert.isTrue(flag)
215-
}).pin()
216-
217-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
218-
const provider = new LockFactory(new store(config))
219-
const lock = provider.createLock('foo')
220-
let flag = false
221-
222-
await lock
223-
.run(async () => {
224-
flag = true
225-
throw new Error('hello world')
226-
})
227-
.catch(() => undefined)
228-
229-
await lock.run(async () => undefined)
230-
assert.isTrue(flag)
231-
}).pin()
232-
233-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
234-
const provider = new LockFactory(new store(config))
235-
const lock = provider.createLock('foo')
236-
let flag = false
237-
238-
await lock
239-
.run(async () => {
240-
flag = true
241-
throw new Error('hello world')
242-
})
243-
.catch(() => undefined)
244-
245-
await lock.run(async () => undefined)
246-
assert.isTrue(flag)
247-
}).pin()
248-
249-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
250-
const provider = new LockFactory(new store(config))
251-
const lock = provider.createLock('foo')
252-
let flag = false
253-
254-
await lock
255-
.run(async () => {
256-
flag = true
257-
throw new Error('hello world')
258-
})
259-
.catch(() => undefined)
260-
261-
await lock.run(async () => undefined)
262-
assert.isTrue(flag)
263-
}).pin()
264-
265-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
266-
const provider = new LockFactory(new store(config))
267-
const lock = provider.createLock('foo')
268-
let flag = false
269-
270-
await lock
271-
.run(async () => {
272-
flag = true
273-
throw new Error('hello world')
274-
})
275-
.catch(() => undefined)
276-
277-
await lock.run(async () => undefined)
278-
assert.isTrue(flag)
279-
}).pin()
280-
281152
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
282153
const provider = new LockFactory(new store(config))
283154
const lock = provider.createLock('foo')
@@ -292,23 +163,7 @@ export function registerStoreTestSuite<T extends { new (options: any): LockStore
292163

293164
await lock.run(async () => undefined)
294165
assert.isTrue(flag)
295-
}).pin()
296-
297-
test('exceptions during run do not leave mutex in locked state', async ({ assert }) => {
298-
const provider = new LockFactory(new store(config))
299-
const lock = provider.createLock('foo')
300-
let flag = false
301-
302-
await lock
303-
.run(async () => {
304-
flag = true
305-
throw new Error('hello world')
306-
})
307-
.catch(() => undefined)
308-
309-
await lock.run(async () => undefined)
310-
assert.isTrue(flag)
311-
}).pin()
166+
})
312167

313168
test('multiple calls to release behave as expected', async ({ assert }) => {
314169
let v = 0

0 commit comments

Comments
 (0)