|
12 | 12 | const expect = require('chai').expect; |
13 | 13 | const WebpackConfig = require('../../lib/WebpackConfig'); |
14 | 14 | const RuntimeConfig = require('../../lib/config/RuntimeConfig'); |
15 | | -const configGenerator = require('../../lib/config-generator'); |
16 | 15 | const eslintLoader = require('../../lib/loaders/eslint'); |
17 | | -const isWindows = (process.platform === 'win32'); |
18 | 16 |
|
19 | 17 | function createConfig() { |
20 | 18 | const runtimeConfig = new RuntimeConfig(); |
@@ -79,29 +77,4 @@ describe('loaders/eslint', () => { |
79 | 77 | const actualOptions = eslintLoader.getOptions(config); |
80 | 78 | expect(actualOptions).to.deep.equals({ foo: true }); |
81 | 79 | }); |
82 | | - |
83 | | - it('configure ESLint loader rule', () => { |
84 | | - const config = createConfig(); |
85 | | - config.outputPath = isWindows ? 'C:\\tmp\\public' : '/tmp/public'; |
86 | | - config.setPublicPath('/'); |
87 | | - config.enableEslintLoader(); |
88 | | - config.configureLoaderRule('eslint', (loader) => { |
89 | | - loader.test = /\.(jsx?|vue)/; |
90 | | - }); |
91 | | - |
92 | | - const webpackConfig = configGenerator(config); |
93 | | - const eslintLoader = webpackConfig.module.rules.find(rule => rule.loader === 'eslint-loader'); |
94 | | - |
95 | | - expect(eslintLoader).to.deep.equals({ |
96 | | - test: /\.(jsx?|vue)/, |
97 | | - enforce: 'pre', |
98 | | - exclude: /node_modules/, |
99 | | - loader: 'eslint-loader', |
100 | | - options: { |
101 | | - cache: true, |
102 | | - emitWarning: true, |
103 | | - parser: 'babel-eslint' |
104 | | - } |
105 | | - }); |
106 | | - }); |
107 | 80 | }); |
0 commit comments