From 4bcd2107d129cec8bed15515590a4fa358071226 Mon Sep 17 00:00:00 2001 From: Fraham Date: Sat, 2 Dec 2017 16:27:09 +0000 Subject: [PATCH] test --- .travis.yml | 4 +- jake.bat | 1 + jake.sh | 2 + package.json | 31 +++++++++++-- tests/build/config/jshint.conf.js | 66 --------------------------- tests/build/config/karma.conf.js | 18 ++++---- tests/build/scripts/build.jakefile.js | 23 +++------- tests/{src => }/colors.js | 0 tests/{src => }/index.html | 0 tests/jake.bat | 1 - tests/jake.sh | 2 - tests/package.json | 33 -------------- tests/src/icon.svg | 17 ------- 13 files changed, 48 insertions(+), 150 deletions(-) create mode 100644 jake.bat create mode 100644 jake.sh delete mode 100644 tests/build/config/jshint.conf.js rename tests/{src => }/colors.js (100%) rename tests/{src => }/index.html (100%) delete mode 100644 tests/jake.bat delete mode 100644 tests/jake.sh delete mode 100644 tests/package.json delete mode 100644 tests/src/icon.svg diff --git a/.travis.yml b/.travis.yml index 2f05c3e..240d3b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ language: node_js node_js: "8.8.1" before_script: - - chmod +x ./tests/jake.sh + - chmod +x ./jake.sh - chmod +x ./tests/build/scripts/run_jake.sh - export DISPLAY=:99.0 - npm install karma-firefox-launcher -script: "node node_modules/gulp/bin/gulp.js build && ./tests/jake.sh loose=true capture=Firefox" +script: "node node_modules/gulp/bin/gulp.js build && ./jake.sh loose=true capture=Firefox" diff --git a/jake.bat b/jake.bat new file mode 100644 index 0000000..f9ae12f --- /dev/null +++ b/jake.bat @@ -0,0 +1 @@ +@call tests\build\scripts\run_jake -f tests\build\scripts\build.jakefile.js %* diff --git a/jake.sh b/jake.sh new file mode 100644 index 0000000..82f8087 --- /dev/null +++ b/jake.sh @@ -0,0 +1,2 @@ +#!/bin/sh +. tests/build/scripts/run_jake.sh -f tests/build/scripts/build.jakefile.js $* diff --git a/package.json b/package.json index 6b2688d..1d5e84b 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,9 @@ "description": "Another CSS framework", "main": "index.js", "scripts": { - "start": "node node_modules/gulp/bin/gulp.js", - "build": "node node_modules/gulp/bin/gulp.js build", - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node node_modules/gulp/bin/gulp.js", + "build": "node node_modules/gulp/bin/gulp.js build", + "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", @@ -19,6 +19,8 @@ }, "homepage": "https://github.com/rhyneav/papercss#readme", "devDependencies": { + "browserify": "^14.1.0", + "chai": "^4.1.2", "gulp": "3.9.1", "gulp-clean-css": "3.9.0", "gulp-connect": "5.0.0", @@ -26,10 +28,33 @@ "gulp-plumber": "1.1.0", "gulp-rename": "1.2.2", "gulp-watch-less": "1.0.1", + "http-server": "^0.9.0", "install": "0.10.1", + "jake": "^8.0.15", + "jshint": "^2.9.4", + "karma": "^1.7.1", + "karma-chai": "^0.1.0", + "karma-commonjs": "1.0.0", + "karma-firefox-launcher": "^1.0.0", + "karma-mocha": "^1.3.0", + "karma-node-modules-middleware": "^1.0.1", + "karma-quixote": "^1.0.0", + "karma-requirejs": "^1.1.0", "less": "2.7.2", + "mocha": "^4.0.1", + "nodemon": "^1.11.0", "normalize.css": "7.0.0", "npm": "5.3.0", + "object-merge": "^2.5.1", + "os": "^0.1.1", + "procfile": "^0.1.1", + "quixote": "^0.14.0", + "request": "^2.83.0", + "requirejs": "^2.3.5", + "semver": "^5.3.0", + "shelljs": "^0.7.6", + "simplebuild-jshint": "^1.3.0", + "simplebuild-karma": "^1.0.0", "webpack-dev-server": "2.7.1" } } diff --git a/tests/build/config/jshint.conf.js b/tests/build/config/jshint.conf.js deleted file mode 100644 index 68f1d81..0000000 --- a/tests/build/config/jshint.conf.js +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2015 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file. - -// Configuration options for JSHint. Change this to match your preferences. - -(function() { - "use strict"; - - var merge = require("object-merge"); - - var universalOptions = { - bitwise: true, - curly: false, - eqeqeq: true, - forin: true, - immed: true, - latedef: false, - newcap: true, - noarg: true, - noempty: true, - nonew: true, - regexp: true, - undef: true, - strict: true, - globalstrict: true, // "global" stricts are okay when using CommonJS modules - trailing: true - }; - - exports.nodeOptions = merge(universalOptions, { - node: true - }); - - exports.clientOptions = merge(universalOptions, { - browser: true - }); - - var universalGlobals = { - // Mocha - before: false, - after: false, - beforeEach: false, - afterEach: false, - describe: false, - it: false - }; - - exports.nodeGlobals = merge(universalGlobals, { - // Jake - jake: false, - desc: false, - task: false, - directory: false, - complete: false, - fail: false - }); - - exports.clientGlobals = merge(universalGlobals, { - // CommonJS - exports: false, - require: false, - module: false, - - // Browser - console: false - }); - -}()); \ No newline at end of file diff --git a/tests/build/config/karma.conf.js b/tests/build/config/karma.conf.js index 7b471e1..5f08370 100644 --- a/tests/build/config/karma.conf.js +++ b/tests/build/config/karma.conf.js @@ -13,13 +13,15 @@ basePath: '../../..', // frameworks to use - frameworks: ['mocha', 'commonjs'], + frameworks: ['mocha'], + + middleware: ['node-modules'], // list of files / patterns to load in the browser files: [ - 'tests/src/**/*.js', - 'tests/node_modules/chai/chai.js', - 'tests/node_modules/quixote/dist/quixote.js', + 'tests/**/*.js', + 'node_modules/**/*.js', + //'node_modules/**/*.js', // QUIXOTE: Serve the CSS file so we can load it in our tests // Mark it `included: false` so Karma doesn't load it automatically { pattern: 'dist/paper.css', included: false } @@ -30,11 +32,9 @@ // preprocess matching files before serving them to the browser // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - 'tests/src/**/*.js': ['commonjs'], - 'tests/node_modules/chai/chai.js': ['commonjs'], - 'tests/node_modules/quixote/dist/quixote.js': ['commonjs'] - }, + //preprocessors: { + // 'tests/**/*.js': ['commonjs'], + //}, // test results reporter to use // possible values: 'dots', 'progress', 'junit', 'growl', 'coverage' diff --git a/tests/build/scripts/build.jakefile.js b/tests/build/scripts/build.jakefile.js index e371876..350ed5b 100644 --- a/tests/build/scripts/build.jakefile.js +++ b/tests/build/scripts/build.jakefile.js @@ -8,16 +8,14 @@ var startTime = Date.now(); - var shell = require("shelljs"); - var jshint = require("simplebuild-jshint"); + var shell = require("../../../node_modules/shelljs/shell.js"); var karma = require("simplebuild-karma"); var browserify = require("../util/browserify_runner.js"); var browsers = require("../config/tested_browsers.js"); - var jshintConfig = require("../config/jshint.conf.js"); var paths = require("../config/paths.js"); - var KARMA_CONFIG = "./build/config/karma.conf.js"; + var KARMA_CONFIG = "./tests/build/config/karma.conf.js"; var strict = !process.env.loose; @@ -42,28 +40,19 @@ //*** LINT - +/** */ desc("Lint everything"); task("lint", ["lintNode", "lintClient"]); task("lintNode", function() { process.stdout.write("Linting Node.js code: "); - jshint.checkFiles({ - files: [ paths.buildDir + "/**/*.js" ], - options: jshintConfig.nodeOptions, - globals: jshintConfig.nodeGlobals - }, complete, fail); - }, { async: true }); + + }, { async: false }); task("lintClient", function() { process.stdout.write("Linting browser code: "); - jshint.checkFiles({ - files: [ paths.clientDir + "/**/*.js" ], - options: jshintConfig.clientOptions, - globals: jshintConfig.clientGlobals - }, complete, fail); - }, { async: true }); + }, { async: false }); //*** TEST diff --git a/tests/src/colors.js b/tests/colors.js similarity index 100% rename from tests/src/colors.js rename to tests/colors.js diff --git a/tests/src/index.html b/tests/index.html similarity index 100% rename from tests/src/index.html rename to tests/index.html diff --git a/tests/jake.bat b/tests/jake.bat deleted file mode 100644 index 774c0fc..0000000 --- a/tests/jake.bat +++ /dev/null @@ -1 +0,0 @@ -@call build\scripts\run_jake -f build\scripts\build.jakefile.js %* diff --git a/tests/jake.sh b/tests/jake.sh deleted file mode 100644 index a3bff26..0000000 --- a/tests/jake.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -. build/scripts/run_jake.sh -f build/scripts/build.jakefile.js $* diff --git a/tests/package.json b/tests/package.json deleted file mode 100644 index 1055f55..0000000 --- a/tests/package.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "papercss-tests", - "version": "1.1.0", - "description": "Another CSS framework", - "dependencies": { - "http-server": "^0.9.0" - }, - "devDependencies": { - "browserify": "^14.1.0", - "chai": "^4.1.2", - "jake": "^8.0.15", - "jshint": "^2.9.4", - "karma": "^1.7.1", - "karma-chai": "^0.1.0", - "karma-commonjs": "1.0.0", - "karma-firefox-launcher": "^1.0.0", - "karma-mocha": "^1.3.0", - "karma-quixote": "^1.0.0", - "less": "2.7.2", - "mocha": "^4.0.1", - "nodemon": "^1.11.0", - "normalize.css": "7.0.0", - "npm": "5.3.0", - "object-merge": "^2.5.1", - "procfile": "^0.1.1", - "quixote": "^0.14.0", - "semver": "^5.3.0", - "shelljs": "^0.7.6", - "simplebuild-jshint": "^1.3.0", - "simplebuild-karma": "^1.0.0", - "webpack-dev-server": "2.7.1" - } -} diff --git a/tests/src/icon.svg b/tests/src/icon.svg deleted file mode 100644 index f493408..0000000 --- a/tests/src/icon.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - -