puppeteer/packages/ng-schematics/test/src/e2e.spec.ts

58 lines
1.6 KiB
TypeScript
Raw Normal View History

2023-06-23 15:23:32 +00:00
import expect from 'expect';
import {
buildTestingTree,
getMultiProjectFile,
setupHttpHooks,
} from './utils.js';
2023-06-23 15:23:32 +00:00
describe('@puppeteer/ng-schematics: e2e', () => {
2023-06-23 15:23:32 +00:00
setupHttpHooks();
describe('Single Project', () => {
it('should create default file', async () => {
const tree = await buildTestingTree('e2e', 'single', {
name: 'myTest',
});
expect(tree.files).toContain('/e2e/tests/my-test.e2e.ts');
expect(tree.files).not.toContain('/e2e/tests/my-test.test.ts');
});
it('should create Node file', async () => {
const tree = await buildTestingTree('e2e', 'single', {
name: 'myTest',
testRunner: 'node',
});
expect(tree.files).not.toContain('/e2e/tests/my-test.e2e.ts');
expect(tree.files).toContain('/e2e/tests/my-test.test.ts');
2023-06-23 15:23:32 +00:00
});
});
describe('Multi projects', () => {
it('should create default file', async () => {
const tree = await buildTestingTree('e2e', 'multi', {
name: 'myTest',
});
expect(tree.files).toContain(
getMultiProjectFile('e2e/tests/my-test.e2e.ts')
);
expect(tree.files).not.toContain(
getMultiProjectFile('e2e/tests/my-test.test.ts')
);
});
it('should create Node file', async () => {
const tree = await buildTestingTree('e2e', 'multi', {
name: 'myTest',
testRunner: 'node',
});
expect(tree.files).not.toContain(
getMultiProjectFile('e2e/tests/my-test.e2e.ts')
);
expect(tree.files).toContain(
getMultiProjectFile('e2e/tests/my-test.test.ts')
);
2023-06-23 15:23:32 +00:00
});
});
});