Skip to content

Migrate from Mocha/Sinon/Chai to Vitest #1366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
"description": "Webpack Encore is a simpler way to integrate Webpack into your application",
"main": "index.js",
"scripts": {
"test": "yarn run test:main && yarn run test:persistent-cache",
"test:main": "mocha --reporter spec test --recursive --ignore test/persistent-cache/*",
"test:persistent-cache": "node run-persistent-tests",
"test": "vitest",
"lint": "eslint lib test index.js .eslintrc.js --report-unused-disable-directives --max-warnings=0",
"travis:lint": "yarn run lint"
},
Expand Down Expand Up @@ -70,12 +68,12 @@
"file-loader": "^6.0.0",
"fork-ts-checker-webpack-plugin": "^7.0.0 || ^8.0.0 || ^9.0.0",
"fs-extra": "^10.0.0",
"get-port": "^7.1.0",
"handlebars": "^4.7.7",
"handlebars-loader": "^1.7.0",
"http-server": "^14.1.0",
"less": "^4.0.0",
"less-loader": "^11.0.0 || ^12.2.0",
"mocha": "^10.0.0",
"postcss": "^8.3.0",
"postcss-loader": "^7.0.0 || ^8.1.0",
"preact": "^10.5.0",
Expand All @@ -85,14 +83,14 @@
"react-dom": "^18.0.0",
"sass": "^1.17.0",
"sass-loader": "^16.0.1",
"sinon": "^14.0.0",
"strip-ansi": "^6.0.0",
"stylus": "^0.63.0",
"stylus-loader": "^7.0.0 || ^8.1.0",
"svelte": "^3.50.0 || ^4.2.2",
"svelte-loader": "^3.1.0",
"ts-loader": "^9.0.0",
"typescript": "^5.0.0",
"vitest": "^3.0.6",
"vue": "^3.2.14",
"vue-loader": "^17.0.0",
"webpack": "^5.72",
Expand Down
18 changes: 0 additions & 18 deletions run-persistent-tests.js

This file was deleted.

1 change: 0 additions & 1 deletion test/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
module.exports = {
"env": {
"node": true,
"mocha": true
}
};
2 changes: 1 addition & 1 deletion test/WebpackConfig.js → test/WebpackConfig.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

'use strict';

const expect = require('chai').expect;
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
const WebpackConfig = require('../lib/WebpackConfig');
const RuntimeConfig = require('../lib/config/RuntimeConfig');
const path = require('path');
Expand Down
197 changes: 88 additions & 109 deletions test/bin/encore.js → test/bin/encore.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,19 @@

'use strict';

const chai = require('chai');
import { describe, it, expect, beforeEach, afterEach, chai } from 'vitest';
import getPort from "get-port";
chai.use(require('chai-fs'));
const expect = chai.expect;
const path = require('path');
const testSetup = require('../helpers/setup');
const fs = require('fs-extra');
const { promisify } = require('util');
const { exec, execSync, spawn } = require('child_process');

const execAsync = promisify(exec);
const projectDir = path.resolve(__dirname, '../', '../');

describe('bin/encore.js', function() {
// being functional tests, these can take quite long
this.timeout(10000);

it('Basic smoke test', (done) => {
testSetup.emptyTmpDir();
describe('bin/encore.js', { sequential: true, timeout: 10000 }, function() {
it('Basic smoke test', async () => {
const testDir = testSetup.createTestAppDir();

fs.writeFileSync(
Expand Down Expand Up @@ -52,23 +49,19 @@
);

const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
exec(`node ${binPath} dev --context=${testDir}`, { cwd: testDir }, (err, stdout, stderr) => {
if (err) {
throw new Error(`Error executing encore: ${err} ${stderr} ${stdout}`);
}
try {
const { stdout, stderr } = await execAsync(`node ${binPath} dev --context=${testDir}`, { cwd: testDir });

expect(stdout).to.contain('Compiled successfully');

expect(stdout).not.to.contain('Hash: ');
expect(stdout).not.to.contain('Version: ');
expect(stdout).not.to.contain('Time: ');

done();
});
} catch (err) {
throw new Error(`Error executing encore: ${err} ${err.stderr} ${err.stdout}`);
}
});

it('Smoke test using the --json option', (done) => {
testSetup.emptyTmpDir();
it('Smoke test using the --json option', async () => {
const testDir = testSetup.createTestAppDir();

fs.writeFileSync(
Expand All @@ -87,10 +80,8 @@
);

const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
exec(`node ${binPath} dev --json --context=${testDir}`, { cwd: testDir }, (err, stdout, stderr) => {
if (err) {
throw new Error(`Error executing encore: ${err} ${stderr} ${stdout}`);
}
try {
const { stdout, stderr } = await execAsync(`node ${binPath} dev --json --context=${testDir}`, { cwd: testDir });

let parsedOutput = null;
try {
Expand All @@ -101,21 +92,18 @@

expect(parsedOutput).to.be.an('object');
expect(parsedOutput.modules).to.be.an('array');

// We expect 4 modules there:
// - webpack/runtime/chunk loaded
// - webpack/runtime/jsonp chunk loading
// - webpack/runtime/hasOwnProperty shorthand
// - ./js/no_require.js
expect(parsedOutput.modules.length).to.equal(4);


done();
});
} catch (err) {
throw new Error(`Error executing encore: ${err} ${err.stderr} ${err.stdout}`);
}
});

it('Smoke test using the --profile option', (done) => {
testSetup.emptyTmpDir();
it('Smoke test using the --profile option', async () => {
const testDir = testSetup.createTestAppDir();

fs.writeFileSync(
Expand All @@ -134,22 +122,19 @@
);

const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
exec(`node ${binPath} dev --profile --context=${testDir}`, { cwd: testDir }, (err, stdout, stderr) => {
if (err) {
throw new Error(`Error executing encore: ${err} ${stderr} ${stdout}`);
}
try {
const { stdout, stderr } = await execAsync(`node ${binPath} dev --profile --context=${testDir}`, { cwd: testDir });

expect(stdout).to.contain('resolving: ');
expect(stdout).to.contain('restoring: ');
expect(stdout).to.contain('integration: ');
expect(stdout).to.contain('building: ');

done();
});
} catch (err) {
throw new Error(`Error executing encore: ${err} ${err.stderr} ${err.stdout}`);
}
});

it('Smoke test using the --keep-public-path option', (done) => {
testSetup.emptyTmpDir();
it('Smoke test using the --keep-public-path option', async () => {
const testDir = testSetup.createTestAppDir();

fs.writeFileSync(
Expand All @@ -168,17 +153,14 @@
);

const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
exec(`node ${binPath} dev --keep-public-path --context=${testDir}`, { cwd: testDir }, (err, stdout, stderr) => {
if (err) {
throw new Error(`Error executing encore: ${err} ${stderr} ${stdout}`);
}

done();
});
try {
await execAsync(`node ${binPath} dev --keep-public-path --context=${testDir}`, { cwd: testDir });
} catch (err) {
throw new Error(`Error executing encore: ${err} ${err.stderr} ${err.stdout}`);
}
});

it('Display an error when calling an unknown method', (done) => {
testSetup.emptyTmpDir();
it('Display an error when calling an unknown method', async () => {
const testDir = testSetup.createTestAppDir();

fs.writeFileSync(
Expand Down Expand Up @@ -207,17 +189,18 @@
);

const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
exec(`node ${binPath} dev --context=${testDir}`, { cwd: testDir }, (err, stdout, stderr) => {
try {
await execAsync(`node ${binPath} dev --context=${testDir}`, { cwd: testDir });
throw new Error('Expected command to fail.');
} catch (err) {
expect(err).not.to.be.null;
expect(stdout).to.contain('is not a recognized property');
expect(stdout).to.contain('or method');
expect(stdout).to.contain('Did you mean');
done();
});
expect(err.stdout).to.contain('is not a recognized property');
expect(err.stdout).to.contain('or method');
expect(err.stdout).to.contain('Did you mean');
}
});

it('Run the webpack-dev-server successfully', (done) => {
testSetup.emptyTmpDir();
it('Run the webpack-dev-server successfully', {timeout: 15000}, async () => {
const testDir = testSetup.createTestAppDir();

fs.writeFileSync(
Expand Down Expand Up @@ -246,57 +229,58 @@

const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
const abortController = new AbortController();
const node = spawn('node', [binPath, 'dev-server', `--context=${testDir}`], {
cwd: testDir,
env: Object.assign({}, process.env, { NO_COLOR: 'true' }),
signal: abortController.signal
});

let stdout = '';
let stderr = '';

node.stdout.on('data', (data) => {
stdout += data.toString();
});

node.stderr.on('data', (data) => {
stderr += data.toString();
});

node.on('error', (error) => {
if (error.name !== 'AbortError') {
throw new Error('Error executing encore', { cause: error });
}
const port = await getPort();
await new Promise(async (resolve, reject) => {
const node = spawn('node', [binPath, 'dev-server', `--context=${testDir}`, `--port=${port}`], {
cwd: testDir,
env: Object.assign({}, process.env, { NO_COLOR: 'true', FORCE_COLOR: 'false' }),
signal: abortController.signal
});

let stdout = '';
let stderr = '';

node.stdout.on('data', (data) => {
stdout += data.toString();
});

node.stderr.on('data', (data) => {
stderr += data.toString();
});

node.on('error', (error) => {
if (error.name !== 'AbortError') {
reject(new Error('Error executing encore', { cause: error }));
}

expect(stdout).to.contain('Running webpack-dev-server ...');
expect(stdout).to.contain('Compiled successfully in');
expect(stdout).to.contain('webpack compiled successfully');
expect(stdout).to.contain('Running webpack-dev-server ...');
expect(stdout).to.contain('Compiled successfully in');
expect(stdout).to.contain('webpack compiled successfully');

expect(stderr).to.contain('[webpack-dev-server] Project is running at:');
expect(stderr).to.contain('[webpack-dev-server] Loopback: http://localhost:8080/');
expect(stderr).to.contain('[webpack-dev-server] Content not from webpack is served from');
expect(stderr).to.contain('[webpack-dev-server] Project is running at:');
expect(stderr).to.contain(`[webpack-dev-server] Loopback: http://localhost:${port}/`);
expect(stderr).to.contain('[webpack-dev-server] Content not from webpack is served from');

done();
});
resolve();
});

setTimeout(() => {
await new Promise(r => setTimeout(r, 9000));
abortController.abort();
}, 5000);
})
});

describe('Without webpack-dev-server installed', () => {
before(() => {
beforeEach(() => {
execSync('yarn remove webpack-dev-server --dev', { cwd: projectDir });
});

after(() => {
afterEach(() => {
// Re-install webpack-dev-server and ensure the project is in a clean state
execSync('git checkout package.json', { cwd: projectDir });
execSync('git checkout package.json yarn.lock', { cwd: projectDir });

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 20 - ubuntu-latest

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 4103, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 18 - ubuntu-latest

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 4091, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 22 - ubuntu-latest

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 4092, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 23 - ubuntu-latest

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 4062, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 20 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 8936, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 18 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 6400, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 23 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 10580, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }

Check failure on line 279 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 22 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: git checkout package.json yarn.lock error: pathspec 'yarn.lock' did not match any file(s) known to git ❯ test/bin/encore.test.js:279:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [] }, { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } ], pid: 2492, stdout: { type: 'Buffer', data: [] }, stderr: { type: 'Buffer', data: [ 101, 114, 114, 111, 114, 58, 32, 112, 97, 116, 104, 115, 112, 101, 99, 32, 39, 121, 97, 114, 110, 46, 108, 111, 99, 107, 39, 32, 100, 105, 100, 32, 110, 111, 116, 32, 109, 97, 116, 99, 104, 32, 97, 110, 121, 32, 102, 105, 108, 101, 40, 115, 41, 32, 107, 110, 111, 119, 110, 32, 116, 111, 32, 103, 105, 116, 10 ] } }
execSync('yarn install', { cwd: projectDir });

Check failure on line 280 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 18 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: yarn install warning " > preact-compat@3.19.0" has incorrect peer dependency "preact@<10". warning "preact-compat > preact-context@1.1.4" has incorrect peer dependency "preact@^8.2.7". error Error: EPERM: operation not permitted, unlink 'D:\a\webpack-encore\webpack-encore\node_modules\@esbuild\win32-x64\esbuild.exe' ❯ test/bin/encore.test.js:280:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 60, 49, 48, 34, 46, 10, 119, 97, 114, 110, 105, 110, 103, 32, 34, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 110, 116, 101, 120, 116, 64, 49, 46, 49, 46, 52, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 94, 56, 46, 50, 46, 55, 34, 46, 10, 101, 114, 114, 111, 114, 32, 69, 114, 114, 111, 114, 58, 32, 69, 80, 69, 82, 77, 58, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 110, 111, 116, 32, 112, 101, 114, 109, 105, 116, 116, 101, 100, 44, 32, 117, 110, 108, 105, 110, 107, 32, 39, 68, 58, 92, 97, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 110, 111, 100, 101, 95, 109, 111, 100, 117, 108, 101, 115, 92, 64, 101, 115, 98, 117, 105, 108, 100, 92, 119, 105, 110, 51, 50, 45, 120, 54, 52, 92, 101, 115, 98, 117, 105, 108, 100, 46, 101, 120, 101, 39, 10 ] } ], pid: 7548, stdout: { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, stderr: { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101,

Check failure on line 280 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 23 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: yarn install warning " > preact-compat@3.19.0" has incorrect peer dependency "preact@<10". warning "preact-compat > preact-context@1.1.4" has incorrect peer dependency "preact@^8.2.7". error Error: EPERM: operation not permitted, unlink 'D:\a\webpack-encore\webpack-encore\node_modules\@esbuild\win32-x64\esbuild.exe' ❯ test/bin/encore.test.js:280:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 60, 49, 48, 34, 46, 10, 119, 97, 114, 110, 105, 110, 103, 32, 34, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 110, 116, 101, 120, 116, 64, 49, 46, 49, 46, 52, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 94, 56, 46, 50, 46, 55, 34, 46, 10, 101, 114, 114, 111, 114, 32, 69, 114, 114, 111, 114, 58, 32, 69, 80, 69, 82, 77, 58, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 110, 111, 116, 32, 112, 101, 114, 109, 105, 116, 116, 101, 100, 44, 32, 117, 110, 108, 105, 110, 107, 32, 39, 68, 58, 92, 97, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 110, 111, 100, 101, 95, 109, 111, 100, 117, 108, 101, 115, 92, 64, 101, 115, 98, 117, 105, 108, 100, 92, 119, 105, 110, 51, 50, 45, 120, 54, 52, 92, 101, 115, 98, 117, 105, 108, 100, 46, 101, 120, 101, 39, 10 ] } ], pid: 2920, stdout: { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, stderr: { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101,

Check failure on line 280 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 20 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: yarn install warning " > preact-compat@3.19.0" has incorrect peer dependency "preact@<10". warning "preact-compat > preact-context@1.1.4" has incorrect peer dependency "preact@^8.2.7". error Error: EPERM: operation not permitted, unlink 'D:\a\webpack-encore\webpack-encore\node_modules\@esbuild\win32-x64\esbuild.exe' ❯ test/bin/encore.test.js:280:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 60, 49, 48, 34, 46, 10, 119, 97, 114, 110, 105, 110, 103, 32, 34, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 110, 116, 101, 120, 116, 64, 49, 46, 49, 46, 52, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 94, 56, 46, 50, 46, 55, 34, 46, 10, 101, 114, 114, 111, 114, 32, 69, 114, 114, 111, 114, 58, 32, 69, 80, 69, 82, 77, 58, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 110, 111, 116, 32, 112, 101, 114, 109, 105, 116, 116, 101, 100, 44, 32, 117, 110, 108, 105, 110, 107, 32, 39, 68, 58, 92, 97, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 110, 111, 100, 101, 95, 109, 111, 100, 117, 108, 101, 115, 92, 64, 101, 115, 98, 117, 105, 108, 100, 92, 119, 105, 110, 51, 50, 45, 120, 54, 52, 92, 101, 115, 98, 117, 105, 108, 100, 46, 101, 120, 101, 39, 10 ] } ], pid: 4684, stdout: { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, stderr: { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101,

Check failure on line 280 in test/bin/encore.test.js

View workflow job for this annotation

GitHub Actions / Node 22 - windows-2019

test/bin/encore.test.js > bin/encore.js > Without webpack-dev-server installed > Throw an error when trying to use the webpack-dev-server if not installed

Error: Command failed: yarn install warning " > preact-compat@3.19.0" has incorrect peer dependency "preact@<10". warning "preact-compat > preact-context@1.1.4" has incorrect peer dependency "preact@^8.2.7". error Error: EPERM: operation not permitted, unlink 'D:\a\webpack-encore\webpack-encore\node_modules\@esbuild\win32-x64\esbuild.exe' ❯ test/bin/encore.test.js:280:13 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Serialized Error: { status: 1, signal: null, output: [ null, { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 60, 49, 48, 34, 46, 10, 119, 97, 114, 110, 105, 110, 103, 32, 34, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 110, 116, 101, 120, 116, 64, 49, 46, 49, 46, 52, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101, 99, 116, 32, 112, 101, 101, 114, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 121, 32, 34, 112, 114, 101, 97, 99, 116, 64, 94, 56, 46, 50, 46, 55, 34, 46, 10, 101, 114, 114, 111, 114, 32, 69, 114, 114, 111, 114, 58, 32, 69, 80, 69, 82, 77, 58, 32, 111, 112, 101, 114, 97, 116, 105, 111, 110, 32, 110, 111, 116, 32, 112, 101, 114, 109, 105, 116, 116, 101, 100, 44, 32, 117, 110, 108, 105, 110, 107, 32, 39, 68, 58, 92, 97, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 119, 101, 98, 112, 97, 99, 107, 45, 101, 110, 99, 111, 114, 101, 92, 110, 111, 100, 101, 95, 109, 111, 100, 117, 108, 101, 115, 92, 64, 101, 115, 98, 117, 105, 108, 100, 92, 119, 105, 110, 51, 50, 45, 120, 54, 52, 92, 101, 115, 98, 117, 105, 108, 100, 46, 101, 120, 101, 39, 10 ] } ], pid: 3916, stdout: { type: 'Buffer', data: [ 91, 49, 47, 53, 93, 32, 86, 97, 108, 105, 100, 97, 116, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 46, 106, 115, 111, 110, 46, 46, 46, 10, 91, 50, 47, 53, 93, 32, 82, 101, 115, 111, 108, 118, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 51, 47, 53, 93, 32, 70, 101, 116, 99, 104, 105, 110, 103, 32, 112, 97, 99, 107, 97, 103, 101, 115, 46, 46, 46, 10, 91, 52, 47, 53, 93, 32, 76, 105, 110, 107, 105, 110, 103, 32, 100, 101, 112, 101, 110, 100, 101, 110, 99, 105, 101, 115, 46, 46, 46, 10, 105, 110, 102, 111, 32, 86, 105, 115, 105, 116, 32, 104, 116, 116, 112, 115, 58, 47, 47, 121, 97, 114, 110, 112, 107, 103, 46, 99, 111, 109, 47, 101, 110, 47, 100, 111, 99, 115, 47, 99, 108, 105, 47, 105, 110, 115, 116, 97, 108, 108, 32, 102, 111, 114, 32, 100, 111, 99, 117, 109, 101, 110, 116, 97, 116, 105, 111, 110, 32, 97, 98, 111, 117, 116, 32, 116, 104, 105, 115, 32, 99, 111, 109, 109, 97, 110, 100, 46, 10 ] }, stderr: { type: 'Buffer', data: [ 119, 97, 114, 110, 105, 110, 103, 32, 34, 32, 62, 32, 112, 114, 101, 97, 99, 116, 45, 99, 111, 109, 112, 97, 116, 64, 51, 46, 49, 57, 46, 48, 34, 32, 104, 97, 115, 32, 105, 110, 99, 111, 114, 114, 101,
});

it('Throw an error when trying to use the webpack-dev-server if not installed', done => {
testSetup.emptyTmpDir();
it('Throw an error when trying to use the webpack-dev-server if not installed', async () => {
const testDir = testSetup.createTestAppDir();

fs.writeFileSync(
Expand Down Expand Up @@ -324,23 +308,18 @@
);

const binPath = path.resolve(projectDir, 'bin', 'encore.js');
exec(
`node ${binPath} dev-server --context=${testDir}`,
{
cwd: testDir,
env: Object.assign({}, process.env, { NO_COLOR: 'true' })
},
(err, stdout, stderr) => {
expect(stdout).to.contain('Install webpack-dev-server to use the webpack Development Server');
expect(stdout).to.contain('npm install webpack-dev-server --save-dev');
expect(stderr).to.equal('');

expect(stdout).not.to.contain('Running webpack-dev-server ...');
expect(stdout).not.to.contain('Compiled successfully in');
expect(stdout).not.to.contain('webpack compiled successfully');

done();
});
const { stdout, stderr } = await execAsync(`node ${binPath} dev-server --context=${testDir}`, {
cwd: testDir,
env: Object.assign({}, process.env, { NO_COLOR: 'true' })
});

expect(stdout).to.contain('Install webpack-dev-server to use the webpack Development Server');
expect(stdout).to.contain('npm install webpack-dev-server --save-dev');
expect(stderr).to.equal('');

expect(stdout).not.to.contain('Running webpack-dev-server ...');
expect(stdout).not.to.contain('Compiled successfully in');
expect(stdout).not.to.contain('webpack compiled successfully');
});
});
});
Loading
Loading