Add start of test suite
This commit is contained in:
Родитель
69675a0fb2
Коммит
ef41de379b
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
10
package.json
10
package.json
|
@ -10,7 +10,8 @@
|
|||
"lint": "eslint src/ && flow check",
|
||||
"prebuild": "npm run clean && npm run lint",
|
||||
"build": "rollup -c && cp src/index.js.flow dist/index.esm.js.flow && cp src/index.js.flow dist/index.umd.js.flow",
|
||||
"test": "npm run lint",
|
||||
"pretest": "npm run build",
|
||||
"test": "karma start test/karma.config.js",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -25,9 +26,16 @@
|
|||
"babel-plugin-transform-custom-element-classes": "^0.1.0",
|
||||
"babel-preset-es2015-rollup": "^3.0.0",
|
||||
"babel-preset-flow": "^6.23.0",
|
||||
"chai": "^4.1.2",
|
||||
"eslint": "^4.19.0",
|
||||
"eslint-plugin-github": "^0.24.0",
|
||||
"flow-bin": "^0.69.0",
|
||||
"karma": "^2.0.0",
|
||||
"karma-chai": "^0.1.0",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"karma-mocha-reporter": "^2.2.5",
|
||||
"mocha": "^5.0.5",
|
||||
"rollup": "^0.57.1",
|
||||
"rollup-plugin-babel": "^3.0.3"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
module.exports = function(config) {
|
||||
config.set({
|
||||
frameworks: ['mocha', 'chai'],
|
||||
files: ['../dist/index.umd.js', 'test.js'],
|
||||
reporters: ['mocha'],
|
||||
port: 9876,
|
||||
colors: true,
|
||||
logLevel: config.LOG_INFO,
|
||||
browsers: ['ChromeHeadless'],
|
||||
autoWatch: false,
|
||||
singleRun: true,
|
||||
concurrency: Infinity
|
||||
})
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
describe('auto-complete element', function() {
|
||||
describe('element creation', function() {
|
||||
it('creates from document.createElement', function() {
|
||||
const el = document.createElement('auto-complete')
|
||||
assert.equal('AUTO-COMPLETE', el.nodeName)
|
||||
})
|
||||
|
||||
it('creates from constructor', function() {
|
||||
const el = new window.AutocompleteElement()
|
||||
assert.equal('AUTO-COMPLETE', el.nodeName)
|
||||
})
|
||||
})
|
||||
})
|
Загрузка…
Ссылка в новой задаче