1 | /**
|
2 | * @jest-environment node
|
3 | *
|
4 | * sassTrue.runSass cannot find the file when testEnvironment is set to `test`
|
5 | * only with dart-sass.
|
6 | * See https://github.com/oddbird/true/issues/156
|
7 | */
|
8 |
|
9 | const fs = require('fs');
|
10 | const path = require('path');
|
11 | const sassTrue = require('sass-true');
|
12 |
|
13 | const testFiles = fs
|
14 | .readdirSync(__dirname)
|
15 | .filter((file) => file.endsWith('.spec.scss'))
|
16 | .map((file) => path.resolve(__dirname, file));
|
17 |
|
18 | testFiles.forEach((file) => {
|
19 | sassTrue.runSass(
|
20 | { file },
|
21 | {
|
22 | describe,
|
23 | it,
|
24 | }
|
25 | );
|
26 | });
|