From 36127792e0e88d6cabd0acdb48f3cc1233ced2f1 Mon Sep 17 00:00:00 2001 From: Ely De La Cruz <603428+elycruz@users.noreply.github.com> Date: Sat, 17 Sep 2022 14:02:05 -0400 Subject: [PATCH] issue-#72 - Cleaned up sass variables extraction test/example. - Updated package version. --- package.json | 2 +- test/assets/expect_a--with-icss-exports.css | 2 +- test/index.test.ts | 21 ++++++++------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 9e6059d..1ac6c66 100644 --- a/package.json +++ b/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", diff --git a/test/assets/expect_a--with-icss-exports.css b/test/assets/expect_a--with-icss-exports.css index b491714..f480c91 100644 --- a/test/assets/expect_a--with-icss-exports.css +++ b/test/assets/expect_a--with-icss-exports.css @@ -1 +1 @@ -body{color:red;background:blue;} +body{color:red;background:blue} diff --git a/test/index.test.ts b/test/index.test.ts index 7bca199..2aa7fd1 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -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 => { @@ -482,6 +477,6 @@ test('When `sourcemap` is set, to `true`, adjacent source map file should be out }); test.after(async (): Promise => { - // return fs.rmdir(tmpDir, {recursive: true}) - // .catch(error); + return fs.rmdir(tmpDir, {recursive: true}) + .catch(error); });