Skip to content

Instantly share code, notes, and snippets.

@weaverryan
Created June 22, 2017 15:54
Show Gist options
  • Save weaverryan/64cae3f603529641dcad781eeb0cdcd9 to your computer and use it in GitHub Desktop.
Save weaverryan/64cae3f603529641dcad781eeb0cdcd9 to your computer and use it in GitHub Desktop.
Functional test Encore
it.only('Vue.js is compiled correctly', (done) => {
const appDir = testSetup.createTestAppDir();
const config = testSetup.createWebpackConfig(appDir, 'www/build', 'dev');
config.setPublicPath('/build');
config.addEntry('main', './vuejs/main');
config.enableVueJsLoader();
testSetup.runWebpack(config, (webpackAssert) => {
expect(config.outputPath).to.be.a.directory().with.deep.files([
'main.js',
'main.css',
'images/logo.png',
'manifest.json'
]);
testSetup.requestTestPage(
path.join(config.getContext(), 'www'),
[
'build/main.js'
],
(browser) => {
// assert that the vue.js app rendered
browser.assert.text('#app h1', 'Welcome to Your Vue.js App');
// make sure the styles are not inlined
browser.assert.elements('style', 0);
done();
}
);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment