This reverts commit bd0fe50a0e.
This commit is contained in:
parent
bd0fe50a0e
commit
8801f79742
|
|
@ -129,9 +129,7 @@ export class TestTypeImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
setCurrentlyLoadingFileSuite(child);
|
setCurrentlyLoadingFileSuite(child);
|
||||||
const result = fn();
|
fn();
|
||||||
if (result instanceof Promise)
|
|
||||||
throw errorWithLocation(location, 'describe cannot use async functions as callbacks');
|
|
||||||
setCurrentlyLoadingFileSuite(suite);
|
setCurrentlyLoadingFileSuite(suite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,17 +48,6 @@ test('it should enforce unique test names based on the describe block name', asy
|
||||||
expect(result.output).toContain(` - tests${path.sep}example.spec.js:8`);
|
expect(result.output).toContain(` - tests${path.sep}example.spec.js:8`);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('it should prohibit async functions in test.describe', async ({ runInlineTest }) => {
|
|
||||||
const result = await runInlineTest({
|
|
||||||
'tests/example.spec.js': `
|
|
||||||
const { test } = pwt;
|
|
||||||
test.describe('hello', async () => { test('my world', () => {}) });
|
|
||||||
`
|
|
||||||
});
|
|
||||||
expect(result.exitCode).toBe(1);
|
|
||||||
expect(result.output).toContain('describe cannot use async functions as callbacks');
|
|
||||||
});
|
|
||||||
|
|
||||||
test('it should not allow multiple tests with the same name in multiple files', async ({ runInlineTest }) => {
|
test('it should not allow multiple tests with the same name in multiple files', async ({ runInlineTest }) => {
|
||||||
const result = await runInlineTest({
|
const result = await runInlineTest({
|
||||||
'tests/example1.spec.js': `
|
'tests/example1.spec.js': `
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue