Skip to content

Commit

Permalink
issue-#72 - Cleaned up sass variables extraction test/example.
Browse files Browse the repository at this point in the history
- Updated package version.
  • Loading branch information
elycruz committed Sep 17, 2022
1 parent 17031fb commit 07aef77
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
24 changes: 17 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-sass",
"version": "1.2.13",
"version": "1.2.14",
"description": "Rollup Sass files.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -57,7 +57,6 @@
},
"dependencies": {
"@rollup/pluginutils": "^3.1.0",
"icss-utils": "^5.1.0",
"resolve": "^1.5.0",
"sass": "^1.7.2"
},
Expand All @@ -71,6 +70,7 @@
"coveralls": "^3.1.1",
"downlevel-dts": "^0.10.0",
"eslint": "^7.32.0",
"icss-utils": "^5.1.0",
"jsdom": "^17.0.0",
"nyc": "^15.1.0",
"postcss": "^8.4.16",
Expand Down
2 changes: 1 addition & 1 deletion test/assets/expect_a--with-icss-exports.css
@@ -1 +1 @@
body{color:red;background:blue;}
body{color:red;background:blue}
21 changes: 8 additions & 13 deletions test/index.test.ts
Expand Up @@ -299,24 +299,19 @@ test('should support processor return type `Promise<{css: string, icssExport: {}
out = Object.assign({}, extractedIcss.icssExports, {
css: cleanedCss,
});
console.table(extractedIcss);
console.log(out);
// console.table(extractedIcss);
// console.log(out);
resolve(out);
}),
options: sassOptions,
}),
],
}),
{output} = await outputBundle.generate(generateOptions);

outputBundle.write({
...generateOptions,
file: path.join(tmpDir, 'with--icss-exports.js'),
});
// console.log('output:', output);
{output} = await outputBundle.generate(generateOptions),
rslt = squash(unwrap(output));

t.true(squash(unwrap(output)).includes(expectA2));
t.true(squash(unwrap(output)).includes(expectB));
t.true(rslt.includes(expectA2));
t.true(rslt.includes(expectB));
});

test('should processor throw error', async t => {
Expand Down Expand Up @@ -482,6 +477,6 @@ test('When `sourcemap` is set, to `true`, adjacent source map file should be out
});

test.after(async (): Promise<any> => {
// return fs.rmdir(tmpDir, {recursive: true})
// .catch(error);
return fs.rmdir(tmpDir, {recursive: true})
.catch(error);
});

0 comments on commit 07aef77

Please sign in to comment.