From 7df51e656810275e5546b4fbf91a29eb863ab31a Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Fri, 9 Oct 2020 13:44:13 +0300 Subject: [PATCH] test: refactor --- test/fixtures/lazy-element.js | 4 ++-- test/fixtures/lazy-negative-refs.js | 6 +++--- test/insert-option.test.js | 1 - test/loader.test.js | 1 - 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test/fixtures/lazy-element.js b/test/fixtures/lazy-element.js index d2898109..1250bb3b 100644 --- a/test/fixtures/lazy-element.js +++ b/test/fixtures/lazy-element.js @@ -3,8 +3,8 @@ const element = document.createElement('div'); element.id = "test-shadow"; document.body.appendChild(element); -const styles = require('./style.css'); -const stylesOther = require('./style-other.css'); +const styles = require('./style.css').default; +const stylesOther = require('./style-other.css').default; styles.use(); stylesOther.use(); diff --git a/test/fixtures/lazy-negative-refs.js b/test/fixtures/lazy-negative-refs.js index 3fa7952f..17530ce0 100644 --- a/test/fixtures/lazy-negative-refs.js +++ b/test/fixtures/lazy-negative-refs.js @@ -1,6 +1,6 @@ -const css = require('./style.css'); +import api from './style.css'; // ref still 0 -css.unuse(); +api.unuse(); // ref 1 -css.use(); +api.use(); diff --git a/test/insert-option.test.js b/test/insert-option.test.js index acd55589..3901f9b4 100644 --- a/test/insert-option.test.js +++ b/test/insert-option.test.js @@ -88,7 +88,6 @@ describe('"insert" option', () => { const entry = getEntryByInjectType('element.js', injectType); const compiler = getCompiler(entry, { - esModule: false, injectType, insert: (element) => document.querySelector('#test-shadow').appendChild(element), diff --git a/test/loader.test.js b/test/loader.test.js index 4ca59b72..979491a0 100644 --- a/test/loader.test.js +++ b/test/loader.test.js @@ -324,7 +324,6 @@ describe('loader', () => { const compiler = getCompiler('./lazy-negative-refs.js', { injectType, - esModule: false, }); const stats = await compile(compiler);