标签:ack RoCE server serve com set www. dep sts
1. package.json
{ "scripts": { "tests": "karma start" }, "devDependencies": { "babel-loader": "^7.1.4", "webpack": "^4.12.0", "jasmine-core": "^3.1.0", "karma": "^2.0.4", "karma-jasmine": "^1.1.2", "jasmine": "^3.1.0", "karma-phantomjs-launcher": "^1.0.4", "karma-webpack": "^3.0.0" } }
2. karma.config.js
module.exports = function(config) { config.set({ browsers: [‘PhantomJS‘], files: [ { pattern: ‘test-context.js‘, watched: false } ], frameworks: [‘jasmine‘], preprocessors: { ‘test-context.js‘: [‘webpack‘] }, webpack: { module: { loaders: [ { test: /\.js/, exclude: /node_modules/, loader: ‘babel-loader‘ } ] }, watch: true }, webpackServer: { noInfo: true } }); };
3. test-context.js
var context = require.context(‘./spec‘, true, /.spec\.js$/); context.keys().forEach(context);
Reference:
http://www.syntaxsuccess.com/viewarticle/writing-jasmine-unit-tests-in-es6
Writing Jasmine Unit Tests In ES6
标签:ack RoCE server serve com set www. dep sts
原文地址:https://www.cnblogs.com/xiaobin-hlj80/p/9259678.html