add first test with jest
This commit is contained in:
@@ -17,8 +17,11 @@ module.exports = {
|
|||||||
window: false,
|
window: false,
|
||||||
collect: false,
|
collect: false,
|
||||||
cy: false,
|
cy: false,
|
||||||
|
test: false,
|
||||||
|
expect: false,
|
||||||
it: false,
|
it: false,
|
||||||
describe: false,
|
describe: false,
|
||||||
|
FileReader: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
extends: [
|
extends: [
|
||||||
|
|||||||
8
babel.config.js
Normal file
8
babel.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
module.exports = {
|
||||||
|
presets: [
|
||||||
|
'@babel/preset-env',
|
||||||
|
],
|
||||||
|
plugins: [
|
||||||
|
'@babel/plugin-syntax-dynamic-import',
|
||||||
|
],
|
||||||
|
}
|
||||||
15
package.json
15
package.json
@@ -10,16 +10,7 @@
|
|||||||
"build:examples": "node ./node_modules/@babel/node/bin/babel-node.js ./build/examples/build.js --env=production",
|
"build:examples": "node ./node_modules/@babel/node/bin/babel-node.js ./build/examples/build.js --env=production",
|
||||||
"release": "yarn build:packages && lerna publish",
|
"release": "yarn build:packages && lerna publish",
|
||||||
"lint": "eslint ./packages/**/src/**",
|
"lint": "eslint ./packages/**/src/**",
|
||||||
"prebuild:packages": "yarn lint",
|
"test": "jest"
|
||||||
"prebuild:examples": "yarn lint"
|
|
||||||
},
|
|
||||||
"babel": {
|
|
||||||
"presets": [
|
|
||||||
"@babel/preset-env"
|
|
||||||
],
|
|
||||||
"plugins": [
|
|
||||||
"@babel/plugin-syntax-dynamic-import"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"postcss": {
|
"postcss": {
|
||||||
"plugins": {
|
"plugins": {
|
||||||
@@ -41,7 +32,9 @@
|
|||||||
"@babel/preset-stage-2": "^7.0.0",
|
"@babel/preset-stage-2": "^7.0.0",
|
||||||
"@babel/runtime": "^7.1.5",
|
"@babel/runtime": "^7.1.5",
|
||||||
"autoprefixer": "^9.3.1",
|
"autoprefixer": "^9.3.1",
|
||||||
|
"babel-core": "^7.0.0-bridge.0",
|
||||||
"babel-eslint": "^10.0.1",
|
"babel-eslint": "^10.0.1",
|
||||||
|
"babel-jest": "^23.6.0",
|
||||||
"babel-loader": "^8.0.4",
|
"babel-loader": "^8.0.4",
|
||||||
"browser-sync": "^2.26.3",
|
"browser-sync": "^2.26.3",
|
||||||
"connect-history-api-fallback": "^1.5.0",
|
"connect-history-api-fallback": "^1.5.0",
|
||||||
@@ -59,6 +52,7 @@
|
|||||||
"http-proxy-middleware": "^0.19.0",
|
"http-proxy-middleware": "^0.19.0",
|
||||||
"http-server": "^0.11.1",
|
"http-server": "^0.11.1",
|
||||||
"imagemin-webpack-plugin": "^2.3.0",
|
"imagemin-webpack-plugin": "^2.3.0",
|
||||||
|
"jest": "^23.6.0",
|
||||||
"lerna": "^3.4.3",
|
"lerna": "^3.4.3",
|
||||||
"mini-css-extract-plugin": "^0.4.4",
|
"mini-css-extract-plugin": "^0.4.4",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
@@ -68,6 +62,7 @@
|
|||||||
"postcss": "^7.0.5",
|
"postcss": "^7.0.5",
|
||||||
"postcss-loader": "^3.0.0",
|
"postcss-loader": "^3.0.0",
|
||||||
"postcss-scss": "^2.0.0",
|
"postcss-scss": "^2.0.0",
|
||||||
|
"regenerator-runtime": "^0.12.1",
|
||||||
"rollup": "^0.67.0",
|
"rollup": "^0.67.0",
|
||||||
"rollup-plugin-buble": "^0.19.4",
|
"rollup-plugin-buble": "^0.19.4",
|
||||||
"rollup-plugin-commonjs": "^9.2.0",
|
"rollup-plugin-commonjs": "^9.2.0",
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ export default class Editor {
|
|||||||
setOptions(options) {
|
setOptions(options) {
|
||||||
const defaultOptions = {
|
const defaultOptions = {
|
||||||
editable: true,
|
editable: true,
|
||||||
|
extensions: [],
|
||||||
content: '',
|
content: '',
|
||||||
onUpdate: () => {},
|
onUpdate: () => {},
|
||||||
}
|
}
|
||||||
|
|||||||
7
packages/tiptap/src/utils/Editor.spec.js
Normal file
7
packages/tiptap/src/utils/Editor.spec.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import Editor from './Editor'
|
||||||
|
|
||||||
|
test('can create editor', () => {
|
||||||
|
const editor = new Editor()
|
||||||
|
|
||||||
|
expect(editor).toBeDefined()
|
||||||
|
})
|
||||||
Reference in New Issue
Block a user