提交 5599ae0b 编写于 作者: U ULIVZ

test($core): use es6 import

ref: https://github.com/facebook/jest/issues/6835
上级 2bdf88c9
{
"env": {
"test": {
"presets": [
["@babel/preset-env", { "targets": { "node": 8 }}]
]
}
}
}
module.exports = {
'env': {
'test': {
'presets': [
['@babel/preset-env', { 'targets': { 'node': 8 }}]
]
}
}
}
// TODO change to ES6 import
// https://github.com/facebook/jest/issues/6835
const Option = require('../../lib/plugin-api/Option')
import Option from '../../lib/plugin-api/Option'
describe('Option', () => {
test('shoould option record the key', () => {
......
......@@ -2,8 +2,8 @@ jest.mock('vuepress-plugin-a')
jest.mock('vuepress-plugin-b')
jest.mock('@org/vuepress-plugin-a')
const PluginAPI = require('../../lib/plugin-api/index')
const { PLUGIN_OPTION_MAP } = require('../../lib/plugin-api/constants')
import PluginAPI from '../../lib/plugin-api/index'
import { PLUGIN_OPTION_MAP } from '../../lib/plugin-api/constants'
describe('Plugin', () => {
test('should \'registerOption\' work.', () => {
......
jest.mock('vuepress-plugin-a')
jest.mock('@org/vuepress-plugin-a')
const {
import {
resolvePlugin,
hydratePlugin,
resolveScopePackage
} = require('../../lib/plugin-api/util')
} from '../../lib/plugin-api/util'
function resolveMockModule (name) {
return require(`../../../../../__mocks__/${name}`)
}
// const Plugin = require('../../lib/plugin-api/index')
describe('resolvePlugin', () => {
test('should resolve scope packages correctly.', () => {
const pkg1 = resolveScopePackage('@vuepress/plugin-a')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册