Skip to content

Commit f68d914

Browse files
author
Andreas Freimuth
committed
Add simple testcase for --keep-public-path
1 parent c22c828 commit f68d914

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/bin/encore.js

+28
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,32 @@ module.exports = Encore.getWebpackConfig();
155155
done();
156156
});
157157
});
158+
159+
it('Smoke test using the --keep-public-path option', (done) => {
160+
testSetup.emptyTmpDir();
161+
const testDir = testSetup.createTestAppDir();
162+
163+
fs.writeFileSync(
164+
path.join(testDir, 'webpack.config.js'),
165+
`
166+
const Encore = require('../../index.js');
167+
Encore
168+
.setOutputPath('build/')
169+
.setPublicPath('/build')
170+
.addEntry('main', './js/no_require')
171+
;
172+
173+
module.exports = Encore.getWebpackConfig();
174+
`
175+
);
176+
177+
const binPath = path.resolve(__dirname, '../', '../', 'bin', 'encore.js');
178+
exec(`node ${binPath} dev --keep-public-path --context=${testDir}`, { cwd: testDir }, (err, stdout, stderr) => {
179+
if (err) {
180+
throw new Error(`Error executing encore: ${err} ${stderr} ${stdout}`);
181+
}
182+
183+
done();
184+
});
185+
});
158186
});

0 commit comments

Comments
 (0)