From 30e90bf3286b520829bc373a9d0004815c86ea22 Mon Sep 17 00:00:00 2001 From: pidanooo Date: Tue, 6 Aug 2019 22:54:29 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=91=E9=91=AB-exercise3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提交 --- .DS_Store | Bin 0 -> 6148 bytes .travis.yml | 4 +++ karma.conf.js | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++ test/test.js | 4 +++ 4 files changed, 79 insertions(+) create mode 100644 .DS_Store create mode 100644 .travis.yml create mode 100644 karma.conf.js diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a80a043fdad646b971c63e58c6a8c67a1397c2bc GIT binary patch literal 6148 zcmeHKu};G<5Per7)B-~{7&9_eVrGe|GO)r2K-*LmkhF-ldlvqIU*P-r0C;yc6?Mys zP<1EWJ^Osmj$foW1|a=ac>#0*wCRei4#N)9arG^0#mpg5bdKw4J|0!`5&Jr!+y7TU z-(7|trg*?Id4HE2JO4DZjU0W~v380X=6Jy*;k+lD6RRsR!5wNcN~}<^x7g&#=@#!9 zLyYmnIAwhgk64gDOL(sduY(&_54lcltQuv)_(&KTmijz9cmMWd_oTVG0J()3Y|G-_zB!t_irNuwh3rYxO8Tqnk0GYlB!sYyvVv^B)0| L!GkOCrwV)lR%l%y literal 0 HcmV?d00001 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..2815c9aa --- /dev/null +++ b/.travis.yml @@ -0,0 +1,4 @@ +language:node_js, +os:osx, +sudo:required, +script:karma start --single-run \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js new file mode 100644 index 00000000..9ad3eac3 --- /dev/null +++ b/karma.conf.js @@ -0,0 +1,71 @@ +// Karma configuration +// Generated on Tue Aug 06 2019 22:07:56 GMT+0800 (GMT+08:00) + +module.exports = function(config) { + config.set({ + + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: '', + + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha'], + + + // list of files / patterns to load in the browser + files: [ + 'https://cdn.bootcss.com/jquery/2.2.4/jquery.js', + 'node_modules/should/should.js', + 'test/**.js' + ], + + + // list of files to exclude + exclude: [ + ], + + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + }, + + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ['progress'], + + + // web server port + port: 9876, + + + // enable / disable colors in the output (reporters and logs) + colors: true, + + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['Chrome'], + + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity + }) +} diff --git a/test/test.js b/test/test.js index 7c01938c..d14dfad0 100644 --- a/test/test.js +++ b/test/test.js @@ -32,5 +32,9 @@ describe('jQuery', function () { it('should able to request https://raw.githubusercontent.com/FE-star/exercise1/master/test/test.js', function (done) { // 使用 jQuery.ajax 请求 https://raw.githubusercontent.com/FE-star/exercise1/master/test/test.js,并验证是否拿到文件 + var url = 'https://raw.githubusercontent.com/FE-star/exercise1/master/test/test.js'; + $.get(url, function () { + done() + }) }) }) \ No newline at end of file