From cfa746d86975576b40c48ef3c006538f48d7c805 Mon Sep 17 00:00:00 2001 From: Suhas Karanth Date: Sun, 16 Jul 2017 13:42:02 +0530 Subject: [PATCH 1/2] chore: Setup eslint config for test folder --- test/.eslintrc | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/.eslintrc diff --git a/test/.eslintrc b/test/.eslintrc new file mode 100644 index 000000000..7eeefc33b --- /dev/null +++ b/test/.eslintrc @@ -0,0 +1,5 @@ +{ + "env": { + "mocha": true + } +} From cce210e8f590dca7935d65a30128326f446c24bd Mon Sep 17 00:00:00 2001 From: Suhas Karanth Date: Sun, 16 Jul 2017 13:43:34 +0530 Subject: [PATCH 2/2] style: Fix eslint errors in test files --- test/fixtures/script-import.js | 2 +- test/fixtures/unit-test.js | 2 +- test/test.js | 23 ++++++++++++----------- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/test/fixtures/script-import.js b/test/fixtures/script-import.js index 8ab20152a..03622bda2 100644 --- a/test/fixtures/script-import.js +++ b/test/fixtures/script-import.js @@ -4,4 +4,4 @@ export default { msg: 'Hello from Component A!' } } -}; \ No newline at end of file +} diff --git a/test/fixtures/unit-test.js b/test/fixtures/unit-test.js index 422357802..a44105ba9 100644 --- a/test/fixtures/unit-test.js +++ b/test/fixtures/unit-test.js @@ -1,5 +1,5 @@ describe('example', function () { it('basic', function (done) { - done(); + done() }) }) diff --git a/test/test.js b/test/test.js index 65c74887f..e737a715d 100644 --- a/test/test.js +++ b/test/test.js @@ -8,9 +8,9 @@ var MemoryFS = require('memory-fs') var expect = require('chai').expect var hash = require('hash-sum') var SSR = require('vue-server-renderer') -var compiler = require('../lib/template-compiler') +// var compiler = require('../lib/template-compiler') var normalizeNewline = require('normalize-newline') -var ExtractTextPlugin = require("extract-text-webpack-plugin") +var ExtractTextPlugin = require('extract-text-webpack-plugin') var SourceMapConsumer = require('source-map').SourceMapConsumer var rawLoaderPath = path.resolve(__dirname, '../index.js') @@ -583,11 +583,11 @@ describe('vue-loader', function () { }) }, (code, warnings) => { // http://stackoverflow.com/questions/17581830/load-node-js-module-from-string-in-memory - function requireFromString(src, filename) { - var Module = module.constructor; - var m = new Module(); - m._compile(src, filename); - return m.exports; + function requireFromString (src, filename) { + var Module = module.constructor + var m = new Module() + m._compile(src, filename) + return m.exports } var output = interopDefault(requireFromString(code, './test.build.js')) @@ -761,11 +761,11 @@ describe('vue-loader', function () { options: { skeletonLoader: { procedure: (content, sourceMap, callback, options) => { - expect(options.foo).to.equal('bar'); - expect(options.opt2).to.equal('value2'); + expect(options.foo).to.equal('bar') + expect(options.opt2).to.equal('value2') // Return the content to output. - return content; + return content } } } @@ -851,7 +851,8 @@ describe('vue-loader', function () { } }, (window, module) => { var results = [] - var vnode = mockRender(module, { + // var vnode = + mockRender(module, { $processStyle: style => results.push(style), transform: 'translateX(10px)' })