fix: unit tests failed caused by project structure change

This commit is contained in:
07akioni 2020-02-12 17:34:58 +08:00
parent acfefe49c8
commit 1ed576013b
15 changed files with 15 additions and 14 deletions

View File

@ -1,7 +1,8 @@
const path = require('path')
exports.alias = {
'naive-ui/lib/icons': path.resolve(__dirname, '../lib/icons')
'naive-ui/lib/icons': path.resolve(__dirname, '../lib/icons'),
'src': path.resolve(__dirname, '../src')
}
exports.docLoaders = [

View File

@ -8,7 +8,7 @@ const config = require('./config')
const webpackConfig = {
mode: 'development',
entry: {
app: ['./index.js']
app: ['./src/index.js']
},
output: {
path: path.resolve(process.cwd(), './dist'),

View File

@ -6,5 +6,5 @@ import 'regenerator-runtime/runtime'
// packagesContext.keys().forEach(packagesContext)
// require all test files (files that ends with .spec.js)
const testsContext = require.context('./specs/packages/common/Pagination', true, /\.spec.js$/)
const testsContext = require.context('./specs/src/Pagination', true, /\.spec.js$/)
testsContext.keys().forEach(testsContext)

View File

@ -1,4 +1,4 @@
import NButton from 'packages/common/Button'
import NButton from 'src/Button'
import { mount, createLocalVue } from '@vue/test-utils'
import { expect } from 'chai'
import sinon from 'sinon'

View File

@ -1,4 +1,4 @@
import NCheckbox from 'packages/common/Checkbox'
import NCheckbox from 'src/Checkbox'
import { mount, createLocalVue } from '@vue/test-utils'
import { expect } from 'chai'

View File

@ -1,7 +1,7 @@
import NGradientText from 'packages/common/GradientText'
import NGradientText from 'src/GradientText'
import { mount, createLocalVue } from '@vue/test-utils'
import { expect } from 'chai'
import { existsInClassList } from '../../utils'
import { existsInClassList } from '../utils'
describe('GradientText', function () {
const localVue = createLocalVue()

View File

@ -1,7 +1,7 @@
import NIcon from 'packages/common/Icon'
import NIcon from 'src/Icon'
import { mount, createLocalVue } from '@vue/test-utils'
import { expect } from 'chai'
import { existsInClassList } from '../../utils'
import { existsInClassList } from '../utils'
describe('Icon', function () {
const localVue = createLocalVue()

View File

@ -1,7 +1,7 @@
import NInput from 'packages/common/Input'
import NInput from 'src/Input'
import { mount, createLocalVue } from '@vue/test-utils'
import { expect } from 'chai'
import { existsInClassList } from '../../utils'
import { existsInClassList } from '../utils'
describe('Input', function () {
const localVue = createLocalVue()

View File

@ -1,4 +1,4 @@
import { pagesToShow, mapPagesToPageItems, pageItems } from 'packages/common/Pagination/src/utils'
import { pagesToShow, mapPagesToPageItems, pageItems } from 'src/Pagination/src/utils'
import { expect } from 'chai'
describe('Pagination', function () {

View File

@ -1,8 +1,8 @@
import NSelect from 'packages/common/Select'
import NSelect from 'src/Select'
import { mount, createLocalVue } from '@vue/test-utils'
import { expect } from 'chai'
import sinon from 'sinon'
import { existsInClassList, sleep } from '../../utils'
import { existsInClassList, sleep } from '../utils'
import _ from 'lodash'
/**