mirror of
https://github.com/papercss/papercss
synced 2024-05-28 11:33:02 +02:00
Remove quixote and minimal tests as they are not relevant anymore
Travis is also disconnected from the repo and we have Netlify previews
This commit is contained in:
parent
fe62b6fd41
commit
c505950f57
33
.travis.yml
33
.travis.yml
|
@ -1,33 +0,0 @@
|
|||
language: node_js
|
||||
node_js: "8.8.1"
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
rooms:
|
||||
- papercss:1MrmPTVH6FLA95Oa5IfXl7xQ#travis
|
||||
|
||||
addons:
|
||||
firefox: latest
|
||||
apt:
|
||||
sources:
|
||||
- google-chrome
|
||||
packages:
|
||||
- google-chrome-stable fluxbox
|
||||
|
||||
before_install:
|
||||
- npm install -g npm@5.10.0
|
||||
|
||||
install:
|
||||
- npm ci
|
||||
|
||||
before_script:
|
||||
- npm run stylelint
|
||||
- "sh -e /etc/init.d/xvfb start"
|
||||
- sleep 3
|
||||
- fluxbox >/dev/null 2>&1 &
|
||||
- chmod +x ./jake.sh
|
||||
- chmod +x ./tests/build/scripts/run_jake.sh
|
||||
- export DISPLAY=:99.0
|
||||
- gulp build
|
||||
|
||||
script: "./jake.sh loose=true capture=Firefox"
|
117
Jakefile.js
117
Jakefile.js
|
@ -1,117 +0,0 @@
|
|||
// Copyright (c) 2012-2014 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
|
||||
|
||||
// Main build file. Contains all tasks needed for normal development.
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var startTime = Date.now();
|
||||
|
||||
var shell = require("shelljs");
|
||||
var karma = require("simplebuild-karma");
|
||||
var browserify = require("./tests/build/util/browserify_runner.js");
|
||||
|
||||
var browsers = require("./tests/build/config/tested_browsers.js");
|
||||
var paths = require("./tests/build/config/paths.js");
|
||||
|
||||
var KARMA_CONFIG = "./tests/build/config/karma.conf.js";
|
||||
|
||||
var strict = !process.env.loose;
|
||||
|
||||
|
||||
//*** GENERAL
|
||||
|
||||
desc("Lint and test");
|
||||
task("default", [ "lint", "test" ], function() {
|
||||
var elapsedSeconds = (Date.now() - startTime) / 1000;
|
||||
console.log("\n\nBUILD OK (" + elapsedSeconds.toFixed(2) + "s)");
|
||||
});
|
||||
|
||||
desc("Start server (for manual testing)");
|
||||
task("run", [ "build" ], function() {
|
||||
jake.exec("node ../node_modules/http-server/bin/http-server " + paths.clientDistDir, { interactive: true }, complete);
|
||||
}, { async: true });
|
||||
|
||||
desc("Delete generated files");
|
||||
task("clean", function() {
|
||||
shell.rm("-rf", paths.generatedDir);
|
||||
});
|
||||
|
||||
|
||||
//*** LINT
|
||||
/** */
|
||||
desc("Lint everything");
|
||||
task("lint", ["lintNode", "lintClient"]);
|
||||
|
||||
task("lintNode", function() {
|
||||
process.stdout.write("Linting Node.js code: ");
|
||||
|
||||
}, { async: false });
|
||||
|
||||
task("lintClient", function() {
|
||||
process.stdout.write("Linting browser code: ");
|
||||
|
||||
}, { async: false });
|
||||
|
||||
//*** TEST
|
||||
|
||||
desc("Start Karma server -- run this first");
|
||||
task("karma", function() {
|
||||
karma.start({
|
||||
configFile: KARMA_CONFIG
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
desc("Run tests");
|
||||
task("test", function() {
|
||||
console.log("Testing browser code: ");
|
||||
|
||||
var browsersToCapture = process.env.capture ? process.env.capture.split(",") : [];
|
||||
karma.run({
|
||||
configFile: KARMA_CONFIG,
|
||||
expectedBrowsers: browsers,
|
||||
strict: strict,
|
||||
capture: browsersToCapture
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
|
||||
//*** BUILD
|
||||
|
||||
desc("Build distribution package");
|
||||
task("build", [ "prepDistDir", "buildClient" ]);
|
||||
|
||||
task("prepDistDir", function() {
|
||||
shell.rm("-rf", paths.distDir);
|
||||
});
|
||||
|
||||
task("buildClient", [ paths.clientDistDir, "bundleClientJs" ], function() {
|
||||
console.log("Copying client code: .");
|
||||
shell.cp(
|
||||
paths.clientDir + "/*.html",
|
||||
paths.clientDir + "/*.css",
|
||||
paths.clientDir + "/*.svg",
|
||||
paths.clientDistDir
|
||||
);
|
||||
});
|
||||
|
||||
task("bundleClientJs", [ paths.clientDistDir ], function() {
|
||||
console.log("Bundling browser code with Browserify: .");
|
||||
browserify.bundle({
|
||||
entry: paths.clientEntryPoint,
|
||||
outfile: paths.clientDistBundle,
|
||||
options: {
|
||||
standalone: "toggle",
|
||||
debug: true
|
||||
}
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
|
||||
//*** CREATE DIRECTORIES
|
||||
|
||||
directory(paths.testDir);
|
||||
directory(paths.clientDistDir);
|
||||
|
||||
}());
|
1
jake.bat
1
jake.bat
|
@ -1 +0,0 @@
|
|||
@call tests\build\scripts\run_jake -f tests\build\scripts\build.Jakefile.js %*
|
2
jake.sh
2
jake.sh
|
@ -1,2 +0,0 @@
|
|||
#!/bin/sh
|
||||
. tests/build/scripts/run_jake.sh -f tests/build/scripts/build.Jakefile.js $*
|
|
@ -1,17 +0,0 @@
|
|||
// Copyright (c) 2012 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
|
||||
|
||||
// A cross-platform mechanism for determining how to run the build.
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var UNIX_BUILD_COMMAND = "./jake.sh";
|
||||
var WINDOWS_BUILD_COMMAND = "jake.bat";
|
||||
|
||||
var os = require("os");
|
||||
|
||||
exports.get = function() {
|
||||
return os.platform() === "win32" ? WINDOWS_BUILD_COMMAND : UNIX_BUILD_COMMAND;
|
||||
//return WINDOWS_BUILD_COMMAND;
|
||||
};
|
||||
|
||||
}());
|
|
@ -1,79 +0,0 @@
|
|||
// Karma configuration
|
||||
// Quixote-specific configuration starts with "QUIXOTE:"
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var paths = require("./paths.js");
|
||||
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
|
||||
// base path, that will be used to resolve files and exclude
|
||||
basePath: '../../..',
|
||||
|
||||
// frameworks to use
|
||||
frameworks: ['mocha', 'commonjs'],
|
||||
|
||||
middleware: ['node-modules'],
|
||||
|
||||
// list of files / patterns to load in the browser
|
||||
files: [
|
||||
'tests/*.js',
|
||||
'tests/vendor/*.js',
|
||||
"node_modules/chai/chai.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 }
|
||||
],
|
||||
|
||||
// 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: {
|
||||
'tests/*.js': ['commonjs'],
|
||||
'tests/vendor/*.js': ['commonjs'],
|
||||
},
|
||||
|
||||
// test results reporter to use
|
||||
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
|
||||
reporters: ['dots'],
|
||||
|
||||
// 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: false,
|
||||
|
||||
// Start these browsers, currently available:
|
||||
// - Chrome
|
||||
// - ChromeCanary
|
||||
// - Firefox
|
||||
// - Opera
|
||||
// - Safari (only Mac)
|
||||
// - PhantomJS
|
||||
// - IE (only Windows)
|
||||
browsers: [],
|
||||
|
||||
// If browser does not capture in given timeout [ms], kill it
|
||||
captureTimeout: 60000,
|
||||
|
||||
// Continuous Integration mode
|
||||
// if true, it capture browsers, run tests and exit
|
||||
singleRun: false
|
||||
});
|
||||
};
|
||||
|
||||
}());
|
|
@ -1,20 +0,0 @@
|
|||
// Copyright (c) 2015 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file.
|
||||
|
||||
// Lists commonly-used directories. They're all relative to the project root.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
generatedDir: "generated",
|
||||
testDir: "generated/test",
|
||||
distDir: "generated/dist",
|
||||
clientDistDir: "generated/dist/client",
|
||||
|
||||
buildDir: "build",
|
||||
clientDir: "src",
|
||||
clientEntryPoint: "src/toggle.js",
|
||||
clientDistBundle: "generated/dist/client/bundle.js"
|
||||
};
|
||||
|
||||
}());
|
|
@ -1,17 +0,0 @@
|
|||
// Copyright (c) 2014 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file.
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
// Uncomment and modify the following list to cause the build to fail unless these browsers are tested.
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
module.exports = [
|
||||
//"IE 10.0.0 (Windows 7 0.0.0)",
|
||||
//"Firefox 41.0.0 (Mac OS X 10.10.0)",
|
||||
//"Chrome 46.0.2490 (Mac OS X 10.10.5)",
|
||||
//"Safari 9.0.1 (Mac OS X 10.10.5)",
|
||||
//"Mobile Safari 8.0.0 (iOS 8.4.0)",
|
||||
//"Chrome Mobile 44.0.2403 (Android 6.0.0)"
|
||||
];
|
||||
|
||||
}());
|
|
@ -1,117 +0,0 @@
|
|||
// Copyright (c) 2012-2014 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
|
||||
|
||||
// Main build file. Contains all tasks needed for normal development.
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var startTime = Date.now();
|
||||
|
||||
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 paths = require("../config/paths.js");
|
||||
|
||||
var KARMA_CONFIG = "./tests/build/config/karma.conf.js";
|
||||
|
||||
var strict = !process.env.loose;
|
||||
|
||||
|
||||
//*** GENERAL
|
||||
|
||||
desc("Lint and test");
|
||||
task("default", [ "lint", "test" ], function() {
|
||||
var elapsedSeconds = (Date.now() - startTime) / 1000;
|
||||
console.log("\n\nBUILD OK (" + elapsedSeconds.toFixed(2) + "s)");
|
||||
});
|
||||
|
||||
desc("Start server (for manual testing)");
|
||||
task("run", [ "build" ], function() {
|
||||
jake.exec("node ../node_modules/http-server/bin/http-server " + paths.clientDistDir, { interactive: true }, complete);
|
||||
}, { async: true });
|
||||
|
||||
desc("Delete generated files");
|
||||
task("clean", function() {
|
||||
shell.rm("-rf", paths.generatedDir);
|
||||
});
|
||||
|
||||
|
||||
//*** LINT
|
||||
/** */
|
||||
desc("Lint everything");
|
||||
task("lint", ["lintNode", "lintClient"]);
|
||||
|
||||
task("lintNode", function() {
|
||||
process.stdout.write("Linting Node.js code: ");
|
||||
|
||||
}, { async: false });
|
||||
|
||||
task("lintClient", function() {
|
||||
process.stdout.write("Linting browser code: ");
|
||||
|
||||
}, { async: false });
|
||||
|
||||
//*** TEST
|
||||
|
||||
desc("Start Karma server -- run this first");
|
||||
task("karma", function() {
|
||||
karma.start({
|
||||
configFile: KARMA_CONFIG
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
desc("Run tests");
|
||||
task("test", function() {
|
||||
console.log("Testing browser code: ");
|
||||
|
||||
var browsersToCapture = process.env.capture ? process.env.capture.split(",") : [];
|
||||
karma.run({
|
||||
configFile: KARMA_CONFIG,
|
||||
expectedBrowsers: browsers,
|
||||
strict: strict,
|
||||
capture: browsersToCapture
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
|
||||
//*** BUILD
|
||||
|
||||
desc("Build distribution package");
|
||||
task("build", [ "prepDistDir", "buildClient" ]);
|
||||
|
||||
task("prepDistDir", function() {
|
||||
shell.rm("-rf", paths.distDir);
|
||||
});
|
||||
|
||||
task("buildClient", [ paths.clientDistDir, "bundleClientJs" ], function() {
|
||||
console.log("Copying client code: .");
|
||||
shell.cp(
|
||||
paths.clientDir + "/*.html",
|
||||
paths.clientDir + "/*.css",
|
||||
paths.clientDir + "/*.svg",
|
||||
paths.clientDistDir
|
||||
);
|
||||
});
|
||||
|
||||
task("bundleClientJs", [ paths.clientDistDir ], function() {
|
||||
console.log("Bundling browser code with Browserify: .");
|
||||
browserify.bundle({
|
||||
entry: paths.clientEntryPoint,
|
||||
outfile: paths.clientDistBundle,
|
||||
options: {
|
||||
standalone: "toggle",
|
||||
debug: true
|
||||
}
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
|
||||
//*** CREATE DIRECTORIES
|
||||
|
||||
directory(paths.testDir);
|
||||
directory(paths.clientDistDir);
|
||||
|
||||
}());
|
|
@ -1,117 +0,0 @@
|
|||
// Copyright (c) 2012-2014 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
|
||||
|
||||
// Main build file. Contains all tasks needed for normal development.
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var startTime = Date.now();
|
||||
|
||||
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 paths = require("../config/paths.js");
|
||||
|
||||
var KARMA_CONFIG = "./tests/build/config/karma.conf.js";
|
||||
|
||||
var strict = !process.env.loose;
|
||||
|
||||
|
||||
//*** GENERAL
|
||||
|
||||
desc("Lint and test");
|
||||
task("default", [ "lint", "test" ], function() {
|
||||
var elapsedSeconds = (Date.now() - startTime) / 1000;
|
||||
console.log("\n\nBUILD OK (" + elapsedSeconds.toFixed(2) + "s)");
|
||||
});
|
||||
|
||||
desc("Start server (for manual testing)");
|
||||
task("run", [ "build" ], function() {
|
||||
jake.exec("node ../node_modules/http-server/bin/http-server " + paths.clientDistDir, { interactive: true }, complete);
|
||||
}, { async: true });
|
||||
|
||||
desc("Delete generated files");
|
||||
task("clean", function() {
|
||||
shell.rm("-rf", paths.generatedDir);
|
||||
});
|
||||
|
||||
|
||||
//*** LINT
|
||||
/** */
|
||||
desc("Lint everything");
|
||||
task("lint", ["lintNode", "lintClient"]);
|
||||
|
||||
task("lintNode", function() {
|
||||
process.stdout.write("Linting Node.js code: ");
|
||||
|
||||
}, { async: false });
|
||||
|
||||
task("lintClient", function() {
|
||||
process.stdout.write("Linting browser code: ");
|
||||
|
||||
}, { async: false });
|
||||
|
||||
//*** TEST
|
||||
|
||||
desc("Start Karma server -- run this first");
|
||||
task("karma", function() {
|
||||
karma.start({
|
||||
configFile: KARMA_CONFIG
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
desc("Run tests");
|
||||
task("test", function() {
|
||||
console.log("Testing browser code: ");
|
||||
|
||||
var browsersToCapture = process.env.capture ? process.env.capture.split(",") : [];
|
||||
karma.run({
|
||||
configFile: KARMA_CONFIG,
|
||||
expectedBrowsers: browsers,
|
||||
strict: strict,
|
||||
capture: browsersToCapture
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
|
||||
//*** BUILD
|
||||
|
||||
desc("Build distribution package");
|
||||
task("build", [ "prepDistDir", "buildClient" ]);
|
||||
|
||||
task("prepDistDir", function() {
|
||||
shell.rm("-rf", paths.distDir);
|
||||
});
|
||||
|
||||
task("buildClient", [ paths.clientDistDir, "bundleClientJs" ], function() {
|
||||
console.log("Copying client code: .");
|
||||
shell.cp(
|
||||
paths.clientDir + "/*.html",
|
||||
paths.clientDir + "/*.css",
|
||||
paths.clientDir + "/*.svg",
|
||||
paths.clientDistDir
|
||||
);
|
||||
});
|
||||
|
||||
task("bundleClientJs", [ paths.clientDistDir ], function() {
|
||||
console.log("Bundling browser code with Browserify: .");
|
||||
browserify.bundle({
|
||||
entry: paths.clientEntryPoint,
|
||||
outfile: paths.clientDistBundle,
|
||||
options: {
|
||||
standalone: "toggle",
|
||||
debug: true
|
||||
}
|
||||
}, complete, fail);
|
||||
}, { async: true });
|
||||
|
||||
|
||||
//*** CREATE DIRECTORIES
|
||||
|
||||
directory(paths.testDir);
|
||||
directory(paths.clientDistDir);
|
||||
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
@echo off
|
||||
REM Runs Jake from node_modules directory, preventing it from needing to be installed globally
|
||||
REM Also ensures node modules have been installed
|
||||
REM There's no Quixote-specific configuration in this file.
|
||||
|
||||
if not exist node_modules\.bin\jake.cmd call npm install
|
||||
node_modules\.bin\jake %*
|
|
@ -1,6 +0,0 @@
|
|||
# Runs Jake from node_modules directory, preventing it from needing to be installed globally
|
||||
# Also ensures node modules have been installed
|
||||
# There's no Quixote-specific configuration in this file.
|
||||
|
||||
[ ! -f node_modules/.bin/jake ] && echo "Installing npm modules:" && npm install
|
||||
node_modules/.bin/jake $*
|
|
@ -1,28 +0,0 @@
|
|||
// Copyright (c) 2015 Titanium I.T. LLC. All rights reserved. For license, see "README" or "LICENSE" file.
|
||||
|
||||
// Automatically runs build when files change.
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var nodemon = require("nodemon");
|
||||
var buildCommand = require("../config/build_command.js");
|
||||
var paths = require("../config/paths.js");
|
||||
|
||||
console.log("*** Using nodemon to run " + buildCommand.get() + ". Type 'rs<enter>' to force restart.");
|
||||
nodemon({
|
||||
ext: "sh bat json js html css",
|
||||
ignore: paths.generatedDir,
|
||||
exec: buildCommand.get() + " " + process.argv.slice(2).join(" "),
|
||||
execMap: {
|
||||
sh: "/bin/sh",
|
||||
bat: "cmd.exe /c",
|
||||
cmd: "cmd.exe /c"
|
||||
}
|
||||
}).on("restart", function(files) {
|
||||
if (files) console.log("*** Restarting due to", files);
|
||||
else console.log("*** Restarting");
|
||||
});
|
||||
|
||||
}());
|
|
@ -1,21 +0,0 @@
|
|||
/* Copyright (c) 2014 Titanium I.T. LLC - See LICENSE.txt for license */
|
||||
|
||||
// Helper function for running Browserify
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
"use strict";
|
||||
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
var browserify = require("browserify");
|
||||
|
||||
exports.bundle = function(config, success, failure) {
|
||||
var b = browserify(config.options);
|
||||
|
||||
b.add(path.resolve(config.entry));
|
||||
b.bundle(function(err, bundle) {
|
||||
if (err) return failure(err);
|
||||
fs.writeFileSync(config.outfile, bundle);
|
||||
return success();
|
||||
});
|
||||
};
|
|
@ -1,76 +0,0 @@
|
|||
// Copyright (c) 2012-2015 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
|
||||
|
||||
// Helper functions for running Karma
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var path = require("path");
|
||||
var sh = require("./sh.js");
|
||||
var runner = require("karma/lib/runner");
|
||||
var server = require("karma/lib/server");
|
||||
|
||||
var KARMA = "node node_modules/karma/bin/karma";
|
||||
|
||||
exports.serve = function(configFile, success, fail) {
|
||||
var command = KARMA + " start " + configFile;
|
||||
sh.run(command, success, function () {
|
||||
fail("Could not start Karma server");
|
||||
});
|
||||
};
|
||||
|
||||
exports.runTests = function(options, success, fail) {
|
||||
options.capture = options.capture || [];
|
||||
var config = {
|
||||
configFile: path.resolve(options.configFile),
|
||||
browsers: options.capture,
|
||||
singleRun: options.capture.length > 0
|
||||
};
|
||||
|
||||
var runKarma = runner.run.bind(runner);
|
||||
if (config.singleRun) runKarma = server.start.bind(server);
|
||||
|
||||
var stdout = new CapturedStdout();
|
||||
runKarma(config, function(exitCode) {
|
||||
stdout.restore();
|
||||
|
||||
if (exitCode) return fail("Client tests failed (did you start the Karma server?)");
|
||||
var browserMissing = checkRequiredBrowsers(options.browsers, stdout);
|
||||
if (browserMissing && options.strict) return fail("Did not test all browsers");
|
||||
if (stdout.capturedOutput.indexOf("TOTAL: 0 SUCCESS") !== -1) return fail("No tests were run!");
|
||||
|
||||
return success();
|
||||
});
|
||||
};
|
||||
|
||||
function checkRequiredBrowsers(requiredBrowsers, stdout) {
|
||||
var browserMissing = false;
|
||||
requiredBrowsers.forEach(function(browser) {
|
||||
browserMissing = lookForBrowser(browser, stdout.capturedOutput) || browserMissing;
|
||||
});
|
||||
return browserMissing;
|
||||
}
|
||||
|
||||
function lookForBrowser(browser, output) {
|
||||
var missing = output.indexOf(browser + ": Executed") === -1;
|
||||
if (missing) console.log("Warning: " + browser + " was not tested!");
|
||||
return missing;
|
||||
}
|
||||
|
||||
function CapturedStdout() {
|
||||
var self = this;
|
||||
self.oldStdout = process.stdout.write;
|
||||
self.capturedOutput = "";
|
||||
|
||||
process.stdout.write = function(data) {
|
||||
self.capturedOutput += data;
|
||||
self.oldStdout.apply(this, arguments);
|
||||
};
|
||||
}
|
||||
|
||||
CapturedStdout.prototype.restore = function() {
|
||||
process.stdout.write = this.oldStdout;
|
||||
};
|
||||
|
||||
}());
|
|
@ -1,54 +0,0 @@
|
|||
// Copyright (c) 2014-2015 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
|
||||
|
||||
// Helper function for running Mocha
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var Mocha = require("mocha");
|
||||
var jake = require("jake");
|
||||
|
||||
exports.runTests = function runTests(options, success, failure) {
|
||||
var mocha = new Mocha(options.options);
|
||||
var files = deglob(options.files);
|
||||
files.forEach(mocha.addFile.bind(mocha));
|
||||
|
||||
// This is a bit of a hack. The issue is this: during test execution, if an exception is thrown inside
|
||||
// of a callback (and keep in mind that assertions throw exceptions), there's no way for Mocha to catch
|
||||
// that exception.
|
||||
// So Mocha registers an 'uncaughtException' handler on Node's process object. That way any unhandled
|
||||
// exception is passed to Mocha.
|
||||
// The problem is that Jake ALSO listens for 'uncaughtException'. Its handler and Mocha's handler don't
|
||||
// get along. Somehow the Jake handler seems to terminate Mocha's test run... not sure why. We need to
|
||||
// disable Jake's handler while Mocha is running.
|
||||
// This code disables ALL uncaughtException handlers and then restores them after Mocha is done. It's
|
||||
// very hacky and likely to cause problems in certain edge cases (for example, '.once' listeners aren't
|
||||
// restored properly), but it seems to be working for now.
|
||||
// It might be possible to create a better solution by using Node's 'domain' module. Something to look
|
||||
// into if you're reading this. Another solution is to just spawn Mocha in a separate process, but I
|
||||
// didn't want the time penalty involved. Besides, this seems to be working okay.
|
||||
var savedListeners = disableExceptionListeners();
|
||||
|
||||
var runner = mocha.run(function(failures) {
|
||||
restoreExceptionListeners(savedListeners);
|
||||
if (failures) return failure("Tests failed");
|
||||
else return success();
|
||||
});
|
||||
};
|
||||
|
||||
function deglob(globs) {
|
||||
return new jake.FileList(globs).toArray();
|
||||
}
|
||||
|
||||
function disableExceptionListeners() {
|
||||
var listeners = process.listeners("uncaughtException");
|
||||
process.removeAllListeners("uncaughtException");
|
||||
return listeners;
|
||||
}
|
||||
|
||||
function restoreExceptionListeners(listeners) {
|
||||
listeners.forEach(process.addListener.bind(process, "uncaughtException"));
|
||||
}
|
||||
|
||||
}());
|
|
@ -1,48 +0,0 @@
|
|||
// Copyright (c) 2012-2015 Titanium I.T. LLC. All rights reserved. See LICENSE.txt for details.
|
||||
|
||||
// Helper functions for running processes.
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var jake = require("jake");
|
||||
|
||||
exports.runMany = function(commands, successCallback, failureCallback) {
|
||||
var stdout = [];
|
||||
function serializedSh(command) {
|
||||
if (command) {
|
||||
run(command, function(oneStdout) {
|
||||
stdout.push(oneStdout);
|
||||
serializedSh(commands.shift());
|
||||
}, failureCallback);
|
||||
}
|
||||
else {
|
||||
successCallback(stdout);
|
||||
}
|
||||
}
|
||||
serializedSh(commands.shift());
|
||||
};
|
||||
|
||||
var run = exports.run = function(oneCommand, successCallback, failureCallback) {
|
||||
var stdout = "";
|
||||
var child = jake.createExec(oneCommand);
|
||||
child.on("stdout", function(data) {
|
||||
process.stdout.write(data);
|
||||
stdout += data;
|
||||
});
|
||||
child.on("stderr", function(data) {
|
||||
process.stderr.write(data);
|
||||
});
|
||||
child.on("cmdEnd", function() {
|
||||
successCallback(stdout);
|
||||
});
|
||||
child.on("error", function() {
|
||||
failureCallback(stdout);
|
||||
});
|
||||
|
||||
console.log("> " + oneCommand);
|
||||
child.run();
|
||||
};
|
||||
|
||||
}());
|
|
@ -1,29 +0,0 @@
|
|||
// Copyright (c) 2013 Titanium I.T. LLC. All rights reserved. See LICENSE.TXT for details.
|
||||
|
||||
// Helper function for checking version numbers.
|
||||
// There's no Quixote-specific configuration in this file.
|
||||
|
||||
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
var semver = require("semver");
|
||||
|
||||
exports.check = function(options, success, fail) {
|
||||
if (options.strict) {
|
||||
if (semver.neq(options.actual, options.expected)) return failWithQualifier("exactly");
|
||||
}
|
||||
else {
|
||||
if (semver.lt(options.actual, options.expected)) return failWithQualifier("at least");
|
||||
if (semver.neq(options.actual, options.expected)) console.log("Warning: Newer " + options.name +
|
||||
" version than expected. Expected " + options.expected + ", but was " + options.actual + ".");
|
||||
}
|
||||
return success();
|
||||
|
||||
function failWithQualifier(qualifier) {
|
||||
return fail("Incorrect " + options.name + " version. Expected " + qualifier +
|
||||
" " + options.expected + ", but was " + options.actual + ".");
|
||||
}
|
||||
};
|
||||
|
||||
}());
|
151
tests/colors.js
151
tests/colors.js
|
@ -1,151 +0,0 @@
|
|||
(function() {
|
||||
"use strict";
|
||||
|
||||
var quixote = require("./vendor/quixote.js");
|
||||
var assert = require("./vendor/chai.js").assert;
|
||||
|
||||
describe("Colors", function() {
|
||||
var frame;
|
||||
var media;
|
||||
var textPrimary;
|
||||
var textSecondary;
|
||||
var textSuccess;
|
||||
var textWarning;
|
||||
var textDanger;
|
||||
var textMuted;
|
||||
|
||||
var backgroundPrimary;
|
||||
var backgroundSecondary;
|
||||
var backgroundSuccess;
|
||||
var backgroundWarning;
|
||||
var backgroundDanger;
|
||||
var backgroundMuted;
|
||||
|
||||
var textOverride;
|
||||
var textNotOverride;
|
||||
|
||||
before(function(done) {
|
||||
frame = quixote.createFrame({
|
||||
stylesheet: "/base/dist/paper.css"
|
||||
}, done);
|
||||
});
|
||||
|
||||
after(function() {
|
||||
frame.remove();
|
||||
});
|
||||
|
||||
beforeEach(function() {
|
||||
frame.reset();
|
||||
|
||||
media = frame.add(
|
||||
"<div class='media'>" +
|
||||
"<div id='text'>" +
|
||||
"<p class='text-primary' id='textPrimary'>text-primary</p>" +
|
||||
"<p class='text-secondary' id='textSecondary'>text-secondary</p>" +
|
||||
"<p class='text-success' id='textSuccess'>text-success</p>" +
|
||||
"<p class='text-warning' id='textWarning'>text-warning</p>" +
|
||||
"<p class='text-danger' id='textDanger'>text-danger</p>" +
|
||||
"<p class='text-muted' id='textMuted'>text-muted</p>" +
|
||||
"</div>" +
|
||||
"<div id='background'>" +
|
||||
"<div class='background-primary' id='backgroundPrimary'>background-primary</div>" +
|
||||
"<div class='background-secondary' id='backgroundSecondary'>background-secondary</div>" +
|
||||
"<div class='background-success' id='backgroundSuccess'>background-success</div>" +
|
||||
"<div class='background-warning' id='backgroundWarning'>background-warning</div>" +
|
||||
"<div class='background-danger' id='backgroundDanger'>background-danger</div>" +
|
||||
"<div class='background-muted' id='backgroundMuted'>background-muted</div>" +
|
||||
"</div>" +
|
||||
"<div id='inheritance'>" +
|
||||
"<div class='text-primary'>" +
|
||||
"<p class='text-success' id='text-override'>text-override</p>" +
|
||||
"<p id='text-not-override'>text-not-override</p>" +
|
||||
"</div>" +
|
||||
"</div>" +
|
||||
"</div>",
|
||||
|
||||
"colors"
|
||||
);
|
||||
|
||||
textPrimary = frame.get("#textPrimary");
|
||||
textSecondary = frame.get("#textSecondary");
|
||||
textSuccess = frame.get("#textSuccess");
|
||||
textWarning = frame.get("#textWarning");
|
||||
textDanger = frame.get("#textDanger");
|
||||
textMuted = frame.get("#textMuted");
|
||||
|
||||
backgroundPrimary = frame.get("#backgroundPrimary");
|
||||
backgroundSecondary = frame.get("#backgroundSecondary");
|
||||
backgroundSuccess = frame.get("#backgroundSuccess");
|
||||
backgroundWarning = frame.get("#backgroundWarning");
|
||||
backgroundDanger = frame.get("#backgroundDanger");
|
||||
backgroundMuted = frame.get("#backgroundMuted");
|
||||
|
||||
textOverride = frame.get("#text-override");
|
||||
textNotOverride = frame.get("#text-not-override");
|
||||
});
|
||||
|
||||
it("Text color is set to primary", function() {
|
||||
assert.equal(textPrimary.getRawStyle("color"), "rgb(65, 64, 62)", "Primary color should be #41403E");
|
||||
});
|
||||
|
||||
it("Text color is set to secondary", function() {
|
||||
assert.equal(textSecondary.getRawStyle("color"), "rgb(0, 113, 222)", "Secondary color should be #0071DE");
|
||||
});
|
||||
|
||||
it("Text color is set to success", function() {
|
||||
assert.equal(textSuccess.getRawStyle("color"), "rgb(134, 163, 97)", "Success color should be #86a361");
|
||||
});
|
||||
|
||||
it("Text color is set to warning", function() {
|
||||
assert.equal(textWarning.getRawStyle("color"), "rgb(221, 205, 69)", "Warning color should be #ddcd45");
|
||||
});
|
||||
|
||||
it("Text color is set to danger", function() {
|
||||
assert.equal(textDanger.getRawStyle("color"), "rgb(167, 52, 45)", "Danger color should be #a7342d");
|
||||
});
|
||||
|
||||
it("Text color is set to muted", function() {
|
||||
assert.equal(textMuted.getRawStyle("color"), "rgb(134, 142, 150)", "Muted color should be #868e96");
|
||||
});
|
||||
|
||||
|
||||
|
||||
it("Background color is set to primary", function() {
|
||||
assert.equal(backgroundPrimary.getRawStyle("background-color"), "rgb(193, 192, 189)", "Primary color should be #C1C0BD");
|
||||
});
|
||||
|
||||
it("Background color is set to secondary", function() {
|
||||
assert.equal(backgroundSecondary.getRawStyle("background-color"), "rgb(222, 239, 255)", "Secondary color should be #DEEFFF");
|
||||
});
|
||||
|
||||
it("Background color is set to success", function() {
|
||||
assert.equal(backgroundSuccess.getRawStyle("background-color"), "rgb(208, 219, 194)", "Success color should be #D0BDC2");
|
||||
});
|
||||
|
||||
it("Background color is set to warning", function() {
|
||||
assert.equal(backgroundWarning.getRawStyle("background-color"), "rgb(245, 240, 198)", "Warning color should be #F5F0C6");
|
||||
});
|
||||
|
||||
it("Background color is set to danger", function() {
|
||||
assert.equal(backgroundDanger.getRawStyle("background-color"), "rgb(240, 203, 201)", "Danger color should be #F0CBC9");
|
||||
});
|
||||
|
||||
it("Background color is set to muted", function() {
|
||||
assert.equal(backgroundMuted.getRawStyle("background-color"), "rgb(230, 231, 233)", "Muted color should be #E6E7E9");
|
||||
});
|
||||
|
||||
it("Text overrides parent style", function(){
|
||||
assert.equal(textOverride.getRawStyle("color"), "rgb(134, 163, 97)", "Success color should be #86a361");
|
||||
});
|
||||
|
||||
|
||||
|
||||
it("Text overrides parent style", function(){
|
||||
assert.equal(textOverride.getRawStyle("color"), "rgb(134, 163, 97)", "Success color should be #86a361");
|
||||
});
|
||||
|
||||
it("Text has parent style", function(){
|
||||
assert.equal(textNotOverride.getRawStyle("color"), "rgb(65, 64, 62)", "Primary color should be #41403E");
|
||||
});
|
||||
});
|
||||
}());
|
|
@ -1,28 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!-- smoke test marker: automatopia home page -->
|
||||
<head>
|
||||
<title>Agile Engineering for the Web</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="./screen.css">
|
||||
|
||||
<script src="bundle.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Note: This page is for manual demonstration of the example code. It's not tested like real production code should be. -->
|
||||
|
||||
<div class="media">
|
||||
<img id="image" class="media__figure" src="icon.svg" width="25" />
|
||||
<p id="content" class="media__body invisible">Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem.</p>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
var image = document.getElementById("image");
|
||||
var content = document.getElementById("content");
|
||||
toggle.init(image, content, "invisible");
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
10707
tests/vendor/chai.js
vendored
10707
tests/vendor/chai.js
vendored
File diff suppressed because it is too large
Load diff
4195
tests/vendor/quixote.js
vendored
4195
tests/vendor/quixote.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue