diff --git a/.gitignore b/.gitignore index d81600636f..cdaa32c173 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,4 @@ node_modules .eslintcache -test/temp/*.css +test/fixtures/reload-config/main.css diff --git a/test/SockJSServer.test.js b/test/SockJSServer.test.js index 48e3d1b416..9456f277f0 100644 --- a/test/SockJSServer.test.js +++ b/test/SockJSServer.test.js @@ -40,11 +40,11 @@ describe('SockJSServer', () => { const client = new SockJS('http://localhost:8080/sockjs-node'); - client.onmessage = function(e) { + client.onmessage = (e) => { data.push(e.data); }; - client.onclose = function() { + client.onclose = () => { data.push('close'); }; diff --git a/test/e2e/Client.test.js b/test/e2e/Client.test.js index 854c4347fd..1ad42f963a 100644 --- a/test/e2e/Client.test.js +++ b/test/e2e/Client.test.js @@ -4,14 +4,15 @@ no-undef */ const fs = require('fs'); -const path = require('path'); +const { resolve } = require('path'); const testServer = require('../helpers/test-server'); const reloadConfig = require('../fixtures/reload-config/webpack.config'); const runBrowser = require('../helpers/run-browser'); +const cssFilePath = resolve(__dirname, '../fixtures/reload-config/main.css'); + describe('reload', () => { describe('hot', () => { - const cssFilePath = path.resolve(__dirname, '../temp/main.css'); beforeAll((done) => { fs.writeFileSync( cssFilePath, @@ -30,6 +31,7 @@ describe('reload', () => { }); afterAll((done) => { + fs.unlinkSync(cssFilePath); testServer.close(done); }); @@ -91,7 +93,6 @@ describe('reload', () => { }); describe('inline', () => { - const cssFilePath = path.resolve(__dirname, '../temp/main.css'); beforeAll((done) => { fs.writeFileSync( cssFilePath, @@ -110,6 +111,7 @@ describe('reload', () => { }); afterAll((done) => { + fs.unlinkSync(cssFilePath); testServer.close(done); }); diff --git a/test/fixtures/reload-config/foo.js b/test/fixtures/reload-config/foo.js index 2e213ce622..74895c921b 100644 --- a/test/fixtures/reload-config/foo.js +++ b/test/fixtures/reload-config/foo.js @@ -1,4 +1,4 @@ 'use strict'; // eslint-disable-next-line import/no-unresolved -require('../../temp/main.css'); +require('./main.css'); diff --git a/test/temp/README.md b/test/temp/README.md deleted file mode 100644 index 39f9a69234..0000000000 --- a/test/temp/README.md +++ /dev/null @@ -1 +0,0 @@ -This directory (test/temp/) is meant to allow tests to write to the filesystem and should only be used for temporary files that could change at any time during testing