-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathsplit-chunks-2.spec.ts
43 lines (39 loc) · 1.17 KB
/
split-chunks-2.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
39
40
41
42
43
import { browserFunctions, StylableProjectRunner } from '@stylable/e2e-test-kit';
import { expect } from 'chai';
import { dirname } from 'path';
const project = 'split-chunks-2';
const projectDir = dirname(
require.resolve(`@stylable/webpack-plugin/test/e2e/projects/${project}/webpack.config`),
);
describe(`(${project})`, () => {
const projectRunner = StylableProjectRunner.mochaSetup(
{
projectDir,
launchOptions: {
// headless: false,
// devtools: true
},
},
before,
afterEach,
after,
);
it('renders css', async () => {
const { page } = await projectRunner.openInBrowser();
const styleElements = await page.evaluate(browserFunctions.getStyleElementsMetadata);
expect(styleElements).to.eql([
{
depth: '1',
id: './node_modules/lib/test.st.css',
},
{
depth: '2',
id: './node_modules/lib/index.st.css',
},
{
depth: '3',
id: './src/index.st.css',
},
]);
});
});