From e6b72789e7382867634691124516d449c7d6261d Mon Sep 17 00:00:00 2001 From: Evan You Date: Thu, 25 Jan 2018 19:32:11 -0500 Subject: [PATCH] test: fix tests --- .../cli-plugin-typescript/__tests__/tsPluginBabel.spec.js | 8 ++++---- packages/@vue/cli-service/__tests__/css.spec.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/@vue/cli-plugin-typescript/__tests__/tsPluginBabel.spec.js b/packages/@vue/cli-plugin-typescript/__tests__/tsPluginBabel.spec.js index e1ec2042ea..fe058d587e 100644 --- a/packages/@vue/cli-plugin-typescript/__tests__/tsPluginBabel.spec.js +++ b/packages/@vue/cli-plugin-typescript/__tests__/tsPluginBabel.spec.js @@ -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 = { diff --git a/packages/@vue/cli-service/__tests__/css.spec.js b/packages/@vue/cli-service/__tests__/css.spec.js index ae8bba6336..874e65901c 100644 --- a/packages/@vue/cli-service/__tests__/css.spec.js +++ b/packages/@vue/cli-service/__tests__/css.spec.js @@ -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 }