Skip to content

Commit 62e8253

Browse files
test: animation properties (#1229)
1 parent c1ca32f commit 62e8253

File tree

4 files changed

+91
-0
lines changed

4 files changed

+91
-0
lines changed

test/__snapshots__/modules-option.test.js.snap

+50
Original file line numberDiff line numberDiff line change
@@ -12472,6 +12472,56 @@ Array [
1247212472

1247312473
exports[`"modules" option should work with the "[local]" placeholder for the "localIdentName" option: warnings 1`] = `Array []`;
1247412474

12475+
exports[`"modules" option should work with the "animation" : errors 1`] = `Array []`;
12476+
12477+
exports[`"modules" option should work with the "animation" : module 1`] = `
12478+
"// Imports
12479+
import ___CSS_LOADER_API_IMPORT___ from \\"../../../../src/runtime/api.js\\";
12480+
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});
12481+
// Module
12482+
___CSS_LOADER_EXPORT___.push([module.id, \\"._2D_a3nRJzeYYTHGyq4Flnv {\\\\n animation: 3s _1mfCY-QJoM3OC5uQJynmBJ;\\\\n}\\\\n\\\\n._2PJ0C1A-J6DQoUOkoQ0iJf {\\\\n animation: _1mfCY-QJoM3OC5uQJynmBJ 3s;\\\\n}\\\\n\\\\n._3YD2YkzQKZPR2NHYPjUkly {\\\\n animation-name: _1mfCY-QJoM3OC5uQJynmBJ;\\\\n}\\\\n\\\\n@keyframes _1mfCY-QJoM3OC5uQJynmBJ {\\\\n 0% {\\\\n background: white;\\\\n }\\\\n 100% {\\\\n background: red;\\\\n }\\\\n}\\", \\"\\"]);
12483+
// Exports
12484+
___CSS_LOADER_EXPORT___.locals = {
12485+
\\"a\\": \\"_2D_a3nRJzeYYTHGyq4Flnv\\",
12486+
\\"animationName\\": \\"_1mfCY-QJoM3OC5uQJynmBJ\\",
12487+
\\"b\\": \\"_2PJ0C1A-J6DQoUOkoQ0iJf\\",
12488+
\\"c\\": \\"_3YD2YkzQKZPR2NHYPjUkly\\"
12489+
};
12490+
export default ___CSS_LOADER_EXPORT___;
12491+
"
12492+
`;
12493+
12494+
exports[`"modules" option should work with the "animation" : result 1`] = `
12495+
Array [
12496+
Array [
12497+
"./modules/issue-1228/source.css",
12498+
"._2D_a3nRJzeYYTHGyq4Flnv {
12499+
animation: 3s _1mfCY-QJoM3OC5uQJynmBJ;
12500+
}
12501+
12502+
._2PJ0C1A-J6DQoUOkoQ0iJf {
12503+
animation: _1mfCY-QJoM3OC5uQJynmBJ 3s;
12504+
}
12505+
12506+
._3YD2YkzQKZPR2NHYPjUkly {
12507+
animation-name: _1mfCY-QJoM3OC5uQJynmBJ;
12508+
}
12509+
12510+
@keyframes _1mfCY-QJoM3OC5uQJynmBJ {
12511+
0% {
12512+
background: white;
12513+
}
12514+
100% {
12515+
background: red;
12516+
}
12517+
}",
12518+
"",
12519+
],
12520+
]
12521+
`;
12522+
12523+
exports[`"modules" option should work with the "animation" : warnings 1`] = `Array []`;
12524+
1247512525
exports[`"modules" option should work with the "auto" by default for icss: errors 1`] = `Array []`;
1247612526

1247712527
exports[`"modules" option should work with the "auto" by default for icss: module 1`] = `
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.a {
2+
animation: 3s animationName;
3+
}
4+
5+
.b {
6+
animation: animationName 3s;
7+
}
8+
9+
.c {
10+
animation-name: animationName;
11+
}
12+
13+
@keyframes animationName {
14+
0% {
15+
background: white;
16+
}
17+
100% {
18+
background: red;
19+
}
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import css from './source.css';
2+
3+
__export__ = css;
4+
5+
export default css;

test/modules-option.test.js

+16
Original file line numberDiff line numberDiff line change
@@ -1473,4 +1473,20 @@ describe('"modules" option', () => {
14731473
expect(getWarnings(stats)).toMatchSnapshot('warnings');
14741474
expect(getErrors(stats)).toMatchSnapshot('errors');
14751475
});
1476+
1477+
it('should work with the "animation" ', async () => {
1478+
const compiler = getCompiler('./modules/issue-1228/source.js', {
1479+
modules: { mode: 'local' },
1480+
});
1481+
const stats = await compile(compiler);
1482+
1483+
expect(
1484+
getModuleSource('./modules/issue-1228/source.css', stats)
1485+
).toMatchSnapshot('module');
1486+
expect(getExecutedCode('main.bundle.js', compiler, stats)).toMatchSnapshot(
1487+
'result'
1488+
);
1489+
expect(getWarnings(stats)).toMatchSnapshot('warnings');
1490+
expect(getErrors(stats)).toMatchSnapshot('errors');
1491+
});
14761492
});

0 commit comments

Comments
 (0)