Skip to content

Commit 3a6bf13

Browse files
test: fix
1 parent 901e6b4 commit 3a6bf13

File tree

2 files changed

+110
-2
lines changed

2 files changed

+110
-2
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,111 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`implementation option 'dart-sass', 'legacy' API: errors 1`] = `[]`;
4+
5+
exports[`implementation option 'dart-sass', 'legacy' API: warnings 1`] = `[]`;
6+
7+
exports[`implementation option 'dart-sass', 'modern' API: errors 1`] = `[]`;
8+
9+
exports[`implementation option 'dart-sass', 'modern' API: warnings 1`] = `[]`;
10+
11+
exports[`implementation option 'dart-sass', 'modern-compiler' API: errors 1`] = `[]`;
12+
13+
exports[`implementation option 'dart-sass', 'modern-compiler' API: warnings 1`] = `[]`;
14+
15+
exports[`implementation option 'sass_string', 'legacy' API: errors 1`] = `[]`;
16+
17+
exports[`implementation option 'sass_string', 'legacy' API: warnings 1`] = `[]`;
18+
19+
exports[`implementation option 'sass-embedded', 'legacy' API: errors 1`] = `[]`;
20+
21+
exports[`implementation option 'sass-embedded', 'legacy' API: warnings 1`] = `[]`;
22+
23+
exports[`implementation option 'sass-embedded', 'modern' API: errors 1`] = `[]`;
24+
25+
exports[`implementation option 'sass-embedded', 'modern' API: warnings 1`] = `[]`;
26+
27+
exports[`implementation option 'sass-embedded', 'modern-compiler' API: errors 1`] = `[]`;
28+
29+
exports[`implementation option 'sass-embedded', 'modern-compiler' API: warnings 1`] = `[]`;
30+
31+
exports[`implementation option not specify with legacy API: errors 1`] = `[]`;
32+
33+
exports[`implementation option not specify with legacy API: warnings 1`] = `[]`;
34+
35+
exports[`implementation option not specify with modern API: errors 1`] = `[]`;
36+
37+
exports[`implementation option not specify with modern API: warnings 1`] = `[]`;
38+
39+
exports[`implementation option not specify with modern-compiler API: errors 1`] = `[]`;
40+
41+
exports[`implementation option not specify with modern-compiler API: warnings 1`] = `[]`;
42+
343
exports[`implementation option not specify with node-sass: errors 1`] = `[]`;
444

545
exports[`implementation option not specify with node-sass: warnings 1`] = `[]`;
46+
47+
exports[`implementation option not specify: errors 1`] = `[]`;
48+
49+
exports[`implementation option not specify: warnings 1`] = `[]`;
50+
51+
exports[`implementation option should not swallow an error when trying to load a sass implementation: errors 1`] = `
52+
[
53+
"ModuleBuildError: Module build failed (from ../src/cjs.js):
54+
Some error sass-embedded",
55+
]
56+
`;
57+
58+
exports[`implementation option should not swallow an error when trying to load a sass implementation: warnings 1`] = `[]`;
59+
60+
exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: errors 1`] = `[]`;
61+
62+
exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: errors 2`] = `[]`;
63+
64+
exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: warnings 1`] = `[]`;
65+
66+
exports[`implementation option should support switching the implementation within the same process when using the modern-compiler API: warnings 2`] = `[]`;
67+
68+
exports[`implementation option should throw an error on an unknown sass implementation: errors 1`] = `
69+
[
70+
"ModuleBuildError: Module build failed (from ../src/cjs.js):
71+
Error: Unknown Sass implementation "strange-sass".",
72+
]
73+
`;
74+
75+
exports[`implementation option should throw an error on an unknown sass implementation: warnings 1`] = `[]`;
76+
77+
exports[`implementation option should throw an error when the "info" is unparseable: errors 1`] = `
78+
[
79+
"ModuleBuildError: Module build failed (from ../src/cjs.js):
80+
Error: Unknown Sass implementation "asdfj".",
81+
]
82+
`;
83+
84+
exports[`implementation option should throw an error when the "info" is unparseable: warnings 1`] = `[]`;
85+
86+
exports[`implementation option should throw error when the "info" does not exist: errors 1`] = `
87+
[
88+
"ModuleBuildError: Module build failed (from ../src/cjs.js):
89+
Error: Unknown Sass implementation.",
90+
]
91+
`;
92+
93+
exports[`implementation option should throw error when the "info" does not exist: warnings 1`] = `[]`;
94+
95+
exports[`implementation option should throw error when unresolved package: errors 1`] = `
96+
[
97+
"ModuleBuildError: Module build failed (from ../src/cjs.js):
98+
Error: Cannot find module 'unresolved' from 'src/utils.js'",
99+
]
100+
`;
101+
102+
exports[`implementation option should throw error when unresolved package: warnings 1`] = `[]`;
103+
104+
exports[`implementation option should try to load using valid order: errors 1`] = `
105+
[
106+
"ModuleBuildError: Module build failed (from ../src/cjs.js):
107+
Some error sass-embedded",
108+
]
109+
`;
110+
111+
exports[`implementation option should try to load using valid order: warnings 1`] = `[]`;

test/implementation-option.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,11 @@ describe("implementation option", () => {
217217

218218
expect(sassEmbeddedSpy).toHaveBeenCalledTimes(0);
219219
expect(sassEmbeddedSpyModernAPI).toHaveBeenCalledTimes(0);
220-
expect(nodeSassSpy).toHaveBeenCalledTimes(1);
220+
expect(nodeSassSpy).toHaveBeenCalledTimes(isNodeSassSupported() ? 1 : 0);
221221
expect(dartSassSpy).toHaveBeenCalledTimes(0);
222-
expect(dartSassSpyModernAPI).toHaveBeenCalledTimes(0);
222+
expect(dartSassSpyModernAPI).toHaveBeenCalledTimes(
223+
isNodeSassSupported() ? 0 : 1,
224+
);
223225

224226
sassEmbeddedSpy.mockClear();
225227
sassEmbeddedSpyModernAPI.mockClear();

0 commit comments

Comments
 (0)