remove passing spec params to SwaggerUIBundle
server test json files via webpack-dev-server
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user