-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathbad-project.spec.ts
38 lines (34 loc) · 1.14 KB
/
bad-project.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { StylableProjectRunner } from '@stylable/e2e-test-kit';
import { expect } from 'chai';
import { dirname } from 'path';
const project = 'bad-project';
const projectDir = dirname(
require.resolve(`@stylable/webpack-plugin/test/e2e/projects/${project}/webpack.config`),
);
describe(`(${project})`, () => {
const projectRunner = StylableProjectRunner.mochaSetup(
{
projectDir,
throwOnBuildError: false,
launchOptions: {
// headless: false
},
},
before,
afterEach,
after,
);
it('reports warnings', () => {
const warnings = projectRunner.getBuildWarningMessages();
// const expected = [/could not resolve "unknown"/, /unknown var "xxx"/];
const expected = [
/cannot extend unknown symbol "unknown"/,
/cannot resolve imported symbol "unknown" from stylesheet "\.\/comp\.st\.css"/,
/unknown var "xxx"/,
];
expect(warnings.length).to.equal(3);
warnings.forEach((warning, i: number) => {
expect(warning).to.match(expected[i]);
});
});
});