@@ -20,23 +20,25 @@ test('it finds css in a <link> tag - HTML', async t => {
2020
2121 t . true ( actual . includes ( '.link-in-html { }' ) )
2222 t . true ( actual . includes ( '@import url("import-in-css.css")' ) )
23- t . true ( actual . includes ( '.css-imported-with-css {}' ) )
23+ t . true ( actual . includes ( '.css-imported-with-css { }' ) )
24+ t . snapshot ( actual )
2425} )
2526
2627test ( 'it finds css in a <link> tag - JS' , async t => {
2728 const actual = await extractCss ( server . url + '/link-tag-js.html' )
2829
29- t . true ( actual . includes ( '.link-tag-created-with-js {} ' ) )
30+ t . true ( actual . includes ( '.link-tag-created-with-js' ) )
3031 t . true ( actual . includes ( '@import url("import-in-css.css")' ) )
31- t . true ( actual . includes ( '.css-imported-with-css {}' ) )
32+ t . true ( actual . includes ( '.css-imported-with-css { }' ) )
33+ t . snapshot ( actual )
3234} )
3335
3436test ( 'it finds css in a <style> tag - HTML' , async t => {
3537 const actual = await extractCss ( server . url + '/style-tag-html.html' )
3638
3739 t . true ( actual . includes ( '.fixture { color: red; }' ) )
3840 t . true ( actual . includes ( '@import url("import-in-css.css")' ) )
39- t . true ( actual . includes ( '.css-imported-with-css {}' ) )
41+ t . true ( actual . includes ( '.css-imported-with-css { }' ) )
4042 t . snapshot ( actual )
4143} )
4244
@@ -49,14 +51,15 @@ test('it reports CSS in a <style> tag in HTML only once', async t => {
4951 const lastOccurence = actual . lastIndexOf ( '.fixture' )
5052
5153 t . is ( firstOccurence , lastOccurence )
54+ t . snapshot ( actual )
5255} )
5356
5457test ( 'it finds css in a <style> tag - JS' , async t => {
5558 const actual = await extractCss ( server . url + '/style-tag-js.html' )
5659
5760 t . true ( actual . includes ( '.fixture { color: red; }' ) )
5861 t . true ( actual . includes ( '@import url("import-in-js.css")' ) )
59- t . true ( actual . includes ( '.css-imported-with-js {}' ) )
62+ t . true ( actual . includes ( '.css-imported-with-js { }' ) )
6063 t . snapshot ( actual )
6164} )
6265
@@ -72,11 +75,12 @@ test('it finds CSS implemented in a mixed methods (inline, links, style tags)',
7275 const actual = await extractCss ( server . url + '/kitchen-sink.html' )
7376
7477 t . true ( actual . includes ( '@import url("import-in-css.css")' ) )
75- t . true ( actual . includes ( '.css-imported-with-css {}' ) )
78+ t . true ( actual . includes ( '.css-imported-with-css { }' ) )
7679 t . true ( actual . includes ( '[x-extract-css-inline-style]' ) )
7780 t . true ( actual . includes ( '[x-extract-css-inline-style] { background-image: url(\'background-image-inline-style-attribute-in-html\'); }' ) )
7881 t . true ( actual . includes ( '[x-extract-css-inline-style] { background-image: url("background-image-inline-style-js-cssText"); }' ) )
7982 t . true ( actual . includes ( '[x-extract-css-inline-style] { background-image: url("background-image-inline-style-js-with-prop"); }' ) )
83+ t . snapshot ( actual )
8084} )
8185
8286test ( 'it finds inline styles - HTML' , async t => {
@@ -111,13 +115,13 @@ test('it returns an array of entries when the `origins` option equals `include`'
111115 } )
112116
113117 t . true ( Array . isArray ( actual ) , 'Result should be an array when { origins: `include` }' )
114- t . is ( actual . length , 10 )
118+ t . is ( actual . length , 12 )
115119
116120 function isString ( item ) {
117121 return typeof item === 'string'
118122 }
119123
120- t . true ( actual . every ( item => isString ( item . type ) && [ 'link-or- import' , 'style' , 'inline' ] . includes ( item . type ) ) )
124+ t . true ( actual . every ( item => isString ( item . type ) && [ 'link' , ' import', 'style' , 'inline' ] . includes ( item . type ) ) )
121125 t . true ( actual . every ( item => isString ( item . href ) ) )
122126 t . true ( actual . every ( item => item . href . startsWith ( 'http://localhost:' ) && / \. ( h t m l | c s s ) $ / . test ( item . href ) ) )
123127 t . true ( actual . every ( item => isString ( item . css ) ) )
0 commit comments