diff --git a/.travis.yml b/.travis.yml index 249cc3e..af00f55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,17 +1,15 @@ language: node_js -dist: trusty -addons: - chrome: stable node_js: - node -#addons: -# sauce_connect: true +dist: trusty +addons: + sauce_connect: true sudo: false cache: directories: - node_modules script: - npm run test:cov - #- npm run test:sauce -after_script: + - npm run test:sauce +after_script: - npm install coveralls && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage \ No newline at end of file diff --git a/README.md b/README.md index 1d32f8e..820faad 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,15 @@ 经典模块化前端UI框架
+ + + --- Layui 是一款采用自身模块规范编写的情怀型前端UI框架,遵循原生HTML/CSS/JS的书写与组织形式,门槛极低,拿来即用。其外在极简,却又不失饱满的内在,体积轻盈,组件丰盈,从核心代码到API的每一处细节都经过精心雕琢,非常适合界面的快速开发。Layui 首个版本发布于2016年金秋,她区别于那些基于MVVM底层的UI框架,却并非逆道而行,而是信奉返璞归真之道。准确地说,她更多是为服务端程序员量身定做,你无需涉足各种前端工具的复杂配置,只需面对浏览器本身,让一切你所需要的元素与交互,从这里信手拈来。 diff --git a/karma.conf.base.js b/karma.conf.base.js index 42e4d9a..bf3ebf1 100644 --- a/karma.conf.base.js +++ b/karma.conf.base.js @@ -57,7 +57,16 @@ module.exports = function (config) { // list of files / patterns to load in the browser - files: sourceFileMap.concat('test/**/*.js'), + files: sourceFileMap.concat('test/**/*.js').concat({ + pattern: 'src/css/**/*', + included: false + }, { + pattern: 'src/font/**/*', + included: false + }, { + pattern: 'src/images/**/*', + included: false + }), // list of files to exclude diff --git a/karma.conf.sauce.js b/karma.conf.sauce.js index 4cd9569..10aed8e 100644 --- a/karma.conf.sauce.js +++ b/karma.conf.sauce.js @@ -35,11 +35,11 @@ var customLaunchers = { browserName: 'chrome' }, - sl_ie_8: { - base: 'SauceLabs', - browserName: 'internet explorer', - version: '8' - }, + // sl_ie_8: { + // base: 'SauceLabs', + // browserName: 'internet explorer', + // version: '8' + // }, sl_ie_9: { base: 'SauceLabs', browserName: 'internet explorer', @@ -84,7 +84,7 @@ module.exports = function (config) { var options = Object.assign(base(config), { reporters: ['mocha', 'saucelabs'], sauceLabs: { - 'testName': 'layui test case', + 'testName': 'layui', 'recordVideo': false, 'recordScreenshots': false, 'startConnect': false, @@ -92,7 +92,7 @@ module.exports = function (config) { 'no-ssl-bump-domains': 'all' }, 'public': 'public', - 'build': process.env.CIRCLE_BUILD_NUM || process.env.SAUCE_BUILD_ID || 'build-' + Date.now(), + 'build': 'layui-build-' + process.env.TRAVIS_BUILD_NUMBER, 'tunnelIdentifier': process.env.TRAVIS_JOB_NUMBER }, customLaunchers: customLaunchers, diff --git a/package.json b/package.json index 28267bf..aaa5cae 100644 --- a/package.json +++ b/package.json @@ -18,28 +18,28 @@ "author": "贤心", "homepage": "http://www.layui.com", "devDependencies": { + "chai": "^4.1.1", + "del": "^2.2.2", "gulp": "^3.9.1", - "gulp-uglify": "^1.5.4", "gulp-concat": "^2.6.0 ", "gulp-header": "^1.8.8", "gulp-if": "^2.0.1", "gulp-minify-css": "^1.2.4", "gulp-rename": "^1.2.2", - "del": "^2.2.2", + "gulp-uglify": "^1.5.4", "gulp-zip": "^4.0.0", - "minimist": "^1.2.0", - "chai": "^3.5.0", "karma": "^1.5.0", "karma-chai": "^0.1.0", "karma-chai-sinon": "^0.1.5", "karma-coverage": "^1.1.1", "karma-mocha": "^1.3.0", - "karma-sauce-launcher": "^1.1.0", "karma-mocha-reporter": "^2.2.3", "karma-phantomjs-launcher": "^1.0.4", + "karma-sauce-launcher": "^1.1.0", + "minimist": "^1.2.0", "mocha": "^3.2.0", - "sinon": "^2.0.0", - "sinon-chai": "^2.8.0" + "sinon": "^3.2.1", + "sinon-chai": "^2.13.0" }, "bugs": { "url": "https://github.com/sentsin/layui/issues" @@ -48,8 +48,7 @@ "doc": "doc", "test": "test" }, - "dependencies": { - }, + "dependencies": {}, "keywords": [ "layui", "ui" diff --git a/test/laytpl.js b/test/lay/modules/laytpl.js similarity index 97% rename from test/laytpl.js rename to test/lay/modules/laytpl.js index cb047a6..1533e90 100644 --- a/test/laytpl.js +++ b/test/lay/modules/laytpl.js @@ -213,7 +213,8 @@ describe('laytpl', function () { it('error var', function () { var result = laytpl('{{ data.xxoo }}').render({}); - expect(result).to.have.string('Can\'t find variable: data'); + expect(result).to.have.string('data'); + expect(result).to.have.string('ReferenceError'); expect(result).to.have.string('Laytpl Error'); }); @@ -221,7 +222,7 @@ describe('laytpl', function () { var result = laytpl('{{# var xxoo = ; }}').render({}); expect(result).to.have.string('Laytpl Error'); - expect(result).to.have.string('Unexpected token \';\''); + expect(result).to.have.string('SyntaxError'); }); }); }); diff --git a/test/layui.js b/test/layui.js new file mode 100644 index 0000000..0a26190 --- /dev/null +++ b/test/layui.js @@ -0,0 +1,174 @@ +/** + * @file layui - 测试 + * @author xuexb