Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 26, 2018
1 parent 8f0b52f commit e6b7278
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ test('using correct loader', () => {

const config = service.resolveWebpackConfig()
const rule = config.module.rules.find(rule => rule.test.test('foo.ts'))
expect(rule.use[0].loader).toBe('cache-loader')
expect(rule.use[1].loader).toBe('babel-loader')
expect(rule.use[2].loader).toBe('cache-loader')
expect(rule.use[3].loader).toBe('ts-loader')
expect(rule.use[0].loader).toMatch('cache-loader')
expect(rule.use[1].loader).toMatch('babel-loader')
expect(rule.use[2].loader).toMatch('cache-loader')
expect(rule.use[3].loader).toMatch('ts-loader')
})

const creatorOptions = {
Expand Down
2 changes: 1 addition & 1 deletion packages/@vue/cli-service/__tests__/css.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const findLoaders = (config, lang) => {

const findOptions = (config, lang, _loader) => {
const rule = findRule(config, lang)
const use = rule.use.find(({ loader }) => `${_loader}-loader` === loader)
const use = rule.use.find(({ loader }) => loader.includes(`${_loader}-loader`))
return use.options
}

Expand Down

0 comments on commit e6b7278

Please sign in to comment.