diff --git a/dev-helpers/template.ejs b/dev-helpers/template.ejs index 66b41a4d..c8a0b0a7 100644 --- a/dev-helpers/template.ejs +++ b/dev-helpers/template.ejs @@ -75,7 +75,6 @@ // Build a system const ui = SwaggerUIBundle({ url: "http://petstore.swagger.io/v2/swagger.json", - spec: spec && JSON.parse(decodeURI(spec)), dom_id: '#swagger-ui', presets: [ SwaggerUIBundle.presets.apis, diff --git a/make-webpack-config.js b/make-webpack-config.js index 76512b0d..87491c3e 100644 --- a/make-webpack-config.js +++ b/make-webpack-config.js @@ -3,6 +3,7 @@ var path = require('path') var webpack = require('webpack') var ExtractTextPlugin = require('extract-text-webpack-plugin') var HtmlWebpackPlugin = require('html-webpack-plugin') +const CopyWebpackPlugin = require('copy-webpack-plugin') var deepExtend = require('deep-extend') const {gitDescribeSync} = require('git-describe') @@ -76,17 +77,12 @@ module.exports = function(rules, options) { plugins.push( new webpack.NoEmitOnErrorsPlugin()) } else { // development mode - var spec - if (specialOptions.testSpecName) { - spec = require('./test/e2e/specs/' + specialOptions.testSpecName) - } - plugins.push( new HtmlWebpackPlugin({ template: 'dev-helpers/template.ejs', - spec: spec && encodeURI(JSON.stringify(spec)) // using given test spec definition }) ) + plugins.push(new CopyWebpackPlugin([ { from: 'test/e2e/specs', to: 'test-specs' } ])) } plugins.push( diff --git a/package.json b/package.json index b58f72aa..e3be2d02 100644 --- a/package.json +++ b/package.json @@ -34,8 +34,7 @@ "just-test": "karma start --config karma.conf.js", "just-test-in-node": "mocha --recursive --compilers js:babel-core/register test/core test/components test/bugs test/swagger-ui-dist-package", "e2e": "nightwatch test/e2e/scenarios --config test/e2e/nightwatch.json --verbose", - "e2e-initial-render": "nightwatch test/e2e/scenarios --config test/e2e/nightwatch.json --group initial-render", - "dev:e2e": "TEST_SPEC_NAME=1.json webpack-dev-server --host 0.0.0.0 --config webpack-hot-dev-server.config.js --inline --hot --progress --content-base dev-helpers/" + "e2e-initial-render": "nightwatch test/e2e/scenarios --config test/e2e/nightwatch.json --group initial-render" }, "dependencies": { "base64-js": "^1.2.0", diff --git a/webpack-hot-dev-server.config.js b/webpack-hot-dev-server.config.js index 2d7f5a0c..cb8e4b70 100644 --- a/webpack-hot-dev-server.config.js +++ b/webpack-hot-dev-server.config.js @@ -57,7 +57,6 @@ var rules = [ module.exports = require("./make-webpack-config")(rules, { _special: { separateStylesheets: false, - testSpecName: process.env['TEST_SPEC_NAME'] }, devtool: "eval", entry: {