This commit is contained in:
David Graham 2018-04-11 13:55:40 -06:00
Родитель 69675a0fb2
Коммит ef41de379b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: AA9405DCE2E0D208
4 изменённых файлов: 3636 добавлений и 8 удалений

3607
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -10,7 +10,8 @@
"lint": "eslint src/ && flow check", "lint": "eslint src/ && flow check",
"prebuild": "npm run clean && npm run lint", "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", "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" "prepublishOnly": "npm run build"
}, },
"keywords": [ "keywords": [
@ -25,9 +26,16 @@
"babel-plugin-transform-custom-element-classes": "^0.1.0", "babel-plugin-transform-custom-element-classes": "^0.1.0",
"babel-preset-es2015-rollup": "^3.0.0", "babel-preset-es2015-rollup": "^3.0.0",
"babel-preset-flow": "^6.23.0", "babel-preset-flow": "^6.23.0",
"chai": "^4.1.2",
"eslint": "^4.19.0", "eslint": "^4.19.0",
"eslint-plugin-github": "^0.24.0", "eslint-plugin-github": "^0.24.0",
"flow-bin": "^0.69.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": "^0.57.1",
"rollup-plugin-babel": "^3.0.3" "rollup-plugin-babel": "^3.0.3"
} }

14
test/karma.config.js Normal file
Просмотреть файл

@ -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
})
}

13
test/test.js Normal file
Просмотреть файл

@ -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)
})
})
})