Remove ES5 compilation for libraries. Remove Node-based Jasmine tests. Tests run in Chromium headless mode.

(I got tired of Babel breaking every time I switched computers.)
This commit is contained in:
Timothy Farrell 2018-03-24 06:00:50 -05:00
parent a17e725339
commit e8764c3072
40 changed files with 7276 additions and 5085 deletions

3
.gitignore vendored
View File

@ -1,5 +1,6 @@
packages/**/node_modules node_modules
packages/**/dist packages/**/dist
packages/**/lib packages/**/lib
package-lock.json
*.sublime-project *.sublime-project
*.sublime-workspace *.sublime-workspace

View File

@ -31,7 +31,6 @@ silly.
These are `npm --global` dependencies: These are `npm --global` dependencies:
* [Lerna 2.0.0](https://lernajs.io/) * [Lerna 2.0.0](https://lernajs.io/)
* [Rollup 0.53.3](https://rollupjs.org/)
# Installation # Installation
@ -39,4 +38,6 @@ These are `npm --global` dependencies:
2. `git clone` the repository 2. `git clone` the repository
3. `lerna bootstrap` 3. `lerna bootstrap`
Now each package is built and ready for use. Stay tuned for working examples. # Run Tests
`lerna run test`

233
bin/runTests.js Executable file
View File

@ -0,0 +1,233 @@
#!/usr/bin/env nodejs
/* runTests.js builds and runs the spec files from the passed directory. */
const fs = require('fs');
const path = require('path');
const url = require('url');
const http = require('http');
const chromeLauncher = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
const SPEC_DIR = 'spec';
const TEST_FILENAME = '.spec_runner.html';
const HOST = '127.0.0.1';
const PORT = 10080;
const DEBUG = false;
const PORTFOLIO_DIR = path.normalize(path.join(__dirname, '..'));
const JASMINE_DIR = path.relative(
PORTFOLIO_DIR,
path.normalize(path.join(PORTFOLIO_DIR, 'vendor', 'jasmine'))
);
if (process.argv.length <= 2) {
console.log(`Usage: ${__filename} path/to/package/dir`);
process.exit(-1);
}
const packageRoot = path.resolve(process.argv[2]);
const testPath = path.join(packageRoot, TEST_FILENAME);
const webRoot = path.relative(PORTFOLIO_DIR, testPath);
const items = fs.readdirSync(packageRoot);
let chrome, protocol;
writeSpecRunner();
startStaticServer();
runTestsInChrome();
// ----------------------
function writeSpecRunner() {
if (items.indexOf(SPEC_DIR) === -1) {
console.log(`ERROR: ${packageRoot} does not contain a "${SPEC_DIR}" folder.`);
process.exit(-1);
}
const specFilenames = fs
.readdirSync(path.join(packageRoot, SPEC_DIR))
.filter(fn => fn.endsWith('.spec.js'))
.map(fn => path.join(SPEC_DIR, fn));
runnerText = `<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner v3.1.0</title>
<link rel="shortcut icon" type="image/png" href="/${JASMINE_DIR}/jasmine_favicon.png">
<link rel="stylesheet" href="/${JASMINE_DIR}/jasmine.css">
<script src="/${JASMINE_DIR}/jasmine.js"></script>
<script src="/${JASMINE_DIR}/jasmine-html.js"></script>
<script defer src="/${JASMINE_DIR}/boot.js"></script>
<!-- normally include source files here, but now we rely on ES6 test modules to load them. -->
<!-- include spec files here... -->
${specFilenames.map(fn => `<script type="module" src="${fn}"></script>`).join('\n ')}
</head><body></body>
</html>`;
fs.writeFileSync(testPath, runnerText);
}
function startStaticServer() {
// An adaptation of https://gist.github.com/ryanflorence/701407
const server = http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname,
filename = path.join(PORTFOLIO_DIR, uri);
fs.access(filename, fs.constants.R_OK, function(err) {
if (err) {
response.writeHead(404, { 'Content-Type': 'text/plain' });
response.write('404 Not Found\n');
response.end();
return;
}
if (fs.statSync(filename).isDirectory()) filename += '/index.html';
fs.readFile(filename, 'binary', function(err, file) {
if (err) {
response.writeHead(500, { 'Content-Type': 'text/plain' });
response.write(err + '\n');
response.end();
return;
}
response.writeHead(200, {
'Content-Type': mime(filename)
});
response.write(file, 'binary');
response.end();
});
});
});
server.on('error', e => {
if (e.code === 'EADDRINUSE') {
console.log('Address in use, retrying...');
setTimeout(() => {
server.close();
server.listen(PORT, HOST);
}, 1000);
}
});
server.listen(parseInt(PORT, 10));
}
async function runTestsInChrome() {
chrome = await launchChrome();
protocol = await CDP({
port: chrome.port
});
const { DOM, Network, Page, Emulation, Runtime, Console, Debugger } = protocol;
await Promise.all([
Network.enable(),
Page.enable(),
DOM.enable(),
Runtime.enable(),
Console.enable(),
DEBUG ? Debugger.enable() : Promise.resolve()
]);
await Page.navigate({ url: `http://${HOST}:${PORT}/${webRoot}` });
let indentation = 0;
const reqMap = new Map();
Network.requestWillBeSent(result => reqMap.set(result.requestId, result.request.url));
Network.loadingFailed(result =>
consolePrint(`\x1b[31mNetwork Error: ${result.errorText} for ${reqMap.get(result.requestId)}`)
);
Runtime.exceptionThrown(result =>
consolePrint(`\x1b[31m${result.exceptionDetails.exception.description}`)
);
Console.messageAdded(result => {
const msg = result.message;
if (msg && msg.source === 'console-api') {
try {
const obj = JSON.parse(msg.text);
if (obj.method === 'group') {
indentation += 2;
consoleNewline();
consolePrint(`\x1b[37m${obj.description}`, indentation, false);
} else if (obj.method === 'groupEnd') {
indentation -= 2;
} else if (obj.status === 'failed') {
obj.failedExpectations.forEach(fe => {
consoleNewline();
// consolePrint(`\x1b[31m${fe.message}`);
consolePrint(`\x1b[31m${fe.stack}`);
});
} else {
consolePrint('\x1b[32m.', 0, false);
}
// console[obj.method || 'log'](`${obj.description}`);
} catch (e) {
if (
msg.text.startsWith('failed after') ||
msg.text.startsWith('incomplete after') ||
msg.text.startsWith('passed after')
) {
let color = 32; // green
let exitCode = 0;
if (!msg.text.startsWith('passed after')) {
color = 31;
exitCode = -1;
}
consoleNewline();
consoleNewline();
consolePrint(`\x1b[${color}m${msg.text}`, 0);
exit(exitCode);
} else {
consolePrint(`\x1b[0m${msg.text}`, 0, true);
}
}
}
});
}
function mime(filename, def = 'text/plain') {
const MIMEMAP = {
js: 'application/javascript',
html: 'text/html; charset=utf-8',
css: 'text/css'
};
return MIMEMAP[path.extname(filename).substr(1)] || def;
}
function consolePrint(message, indent = 0, newline = true) {
process.stdout.write(`${new Array(indent).join(' ')}${message}`);
if (newline) {
consoleNewline('\n');
}
}
function consoleNewline() {
process.stdout.write('\x1b[0m\n');
}
async function launchChrome() {
return await chromeLauncher.launch({
chromeFlags: ['--disable-gpu', '--disable-web-security', '--user-data-dir'].concat(
DEBUG ? [] : ['--headless']
)
});
}
function exit(code) {
if (DEBUG) {
return;
}
fs.unlink(testPath);
protocol.close();
chrome.kill();
process.exit(code);
}

View File

@ -1,5 +1,7 @@
{ {
"devDependencies": { "devDependencies": {
"chrome-launcher": "^0.10.2",
"chrome-remote-interface": "^0.25.5",
"lerna": "2.0.0-beta.32" "lerna": "2.0.0-beta.32"
} }
} }

View File

@ -1,35 +1,13 @@
{ {
"name": "frptools", "name": "frptools",
"version": "3.0.1", "version": "3.1.0",
"description": "Observable Property and Computed data streams", "description": "Observable Property and Computed data streams",
"main": "lib/index.js", "main": "src/index.js",
"jsnext:main": "src/index.js", "files": ["src"],
"files": ["dist", "lib", "src"],
"scripts": { "scripts": {
"clean": "rimraf dist lib", "test": "node ../../bin/runTests.js ./"
"build:lib": "NODE_ENV=production babel src --presets=\"stage-0,es2015\" --out-dir lib",
"build:umd": "npm run build:lib && NODE_ENV=production rollup -c",
"build:umd:min":
"npm run build:umd && uglifyjs -m --screw-ie8 -c -o dist/frptools.min.js dist/frptools.js",
"build:umd:gzip":
"npm run build:umd:min && gzip -c9 dist/frptools.min.js > dist/frptools.min.js.gz",
"build": "npm run build:umd:gzip && ls -l dist/",
"prepublish": "npm run clean && npm run build",
"test": "npm run build:lib && jasmine",
"uglifyjs": "2.4.10"
}, },
"keywords": ["reactive"], "keywords": ["reactive"],
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)", "author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
"license": "Apache-2.0", "license": "Apache-2.0"
"devDependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-preset-es2015": "6.18.0",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-stage-0": "6.16.0",
"jasmine": "^2.5.3",
"rimraf": "2.5.4",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-json": "2.1.0"
}
} }

View File

@ -1,21 +0,0 @@
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
const babelConfig = {
env: {
es6: true,
browser: true
},
plugins: [],
presets: ['es2015-rollup']
};
export default {
entry: 'src/index.js',
moduleName: 'frptools',
plugins: [json(), babel(babelConfig)],
output: {
format: 'umd',
file: 'dist/frptools.js'
}
};

View File

@ -1,7 +1,7 @@
const { prop, computed } = require('../lib/index.js'); import { prop, computed } from '../src/index.js';
const { dirtyMock, hashSet } = require('../lib/testUtil.js'); import { dirtyMock, hashSet } from '../src/testUtil.js';
describe('computed', () => { describe('A computed', () => {
const add = (a, b) => a + b; const add = (a, b) => a + b;
const square = a => a * a; const square = a => a * a;

View File

@ -1,5 +1,5 @@
const { container, computed } = require('../lib/index.js'); import { container, computed } from '../src/index.js';
const { dirtyMock, hashSet } = require('../lib/testUtil.js'); import { dirtyMock, hashSet } from '../src/testUtil.js';
describe('A container', () => { describe('A container', () => {
it('notifies dependents of updates', () => { it('notifies dependents of updates', () => {

View File

@ -1,5 +1,5 @@
const { prop } = require('../lib/index.js'); import { prop } from '../src/index.js';
const { dirtyMock, hashSet } = require('../lib/testUtil.js'); import { dirtyMock, hashSet } from '../src/testUtil.js';
describe('A property', () => { describe('A property', () => {
it('returns its initialized value', () => { it('returns its initialized value', () => {

View File

@ -1,7 +0,0 @@
{
"spec_dir": "spec",
"spec_files": ["**/*[sS]pec.js"],
"helpers": ["helpers/**/*.js"],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@ -1,4 +1,4 @@
export { prop } from './property'; export { prop } from './property.js';
export { computed } from './computed'; export { computed } from './computed.js';
export { container } from './container'; export { container } from './container.js';
export { call, id, pick } from './util.js'; export { call, id, pick } from './util.js';

View File

@ -2,8 +2,6 @@
"name": "Gallery", "name": "Gallery",
"version": "0.0.1", "version": "0.0.1",
"description": "Personal photo gallery", "description": "Personal photo gallery",
"main": "lib/index.js",
"jsnext:main": "src/index.js",
"keywords": ["javascript"], "keywords": ["javascript"],
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)", "author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
"license": "Apache-2.0", "license": "Apache-2.0",
@ -16,7 +14,7 @@
"domvm": "~3.2.1", "domvm": "~3.2.1",
"exif-parser": "~0.1.9", "exif-parser": "~0.1.9",
"extract-text-webpack-plugin": "^3.0.2", "extract-text-webpack-plugin": "^3.0.2",
"frptools": "3.0.1", "frptools": "3.1.0",
"linear-partitioning": "0.3.2", "linear-partitioning": "0.3.2",
"pica": "~2.0.8", "pica": "~2.0.8",
"pouchdb-adapter-http": "~6.4.1", "pouchdb-adapter-http": "~6.4.1",
@ -26,7 +24,7 @@
"pouchdb-core": "~6.4.1", "pouchdb-core": "~6.4.1",
"pouchdb-find": "~6.4.1", "pouchdb-find": "~6.4.1",
"pouchdb-replication": "~6.4.1", "pouchdb-replication": "~6.4.1",
"router": "2.0.0", "router": "2.1.0",
"semantic-ui-reset": "^2.2.12", "semantic-ui-reset": "^2.2.12",
"semantic-ui-site": "^2.2.12", "semantic-ui-site": "^2.2.12",
"style-loader": "^0.19.0", "style-loader": "^0.19.0",

View File

@ -1,39 +1,13 @@
{ {
"name": "portal", "name": "portal",
"version": "0.8.0", "version": "0.9.0",
"description": "Expose an API to a web worker and its parent", "description": "Expose an API to a web worker and its parent",
"main": "lib/index.js", "main": "src/index.js",
"jsnext:main": "src/index.js", "files": ["src"],
"files": ["dist", "lib", "src"],
"scripts": { "scripts": {
"lint": "eslint src", "test": "node ../../bin/runTests.js ./"
"clean": "rimraf dist lib",
"build:lib": "NODE_ENV=production babel src --presets=\"stage-0,es2015\" --out-dir lib",
"build:umd": "npm run build:lib && NODE_ENV=production rollup -c",
"build:umd:min":
"npm run build:umd && uglifyjs -m --screw-ie8 -c -o dist/worker-portal.min.js dist/worker-portal.js",
"build:umd:gzip":
"npm run build:umd:min && gzip -c9 dist/worker-portal.min.js > dist/worker-portal.min.js.gz",
"build": "npm run build:umd:gzip && ls -l dist/",
"prepublish": "npm run clean && npm run build",
"test": "npm run build:lib && jasmine --verbose"
}, },
"keywords": ["worker", "webworker"], "keywords": ["worker", "webworker"],
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)", "author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
"license": "Apache-2.0", "license": "Apache-2.0"
"devDependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-preset-es2015": "6.18.0",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-stage-0": "6.16.0",
"jasmine": "^2.5.3",
"rimraf": "2.5.4",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-json": "2.1.0",
"uglifyjs": "2.4.10"
},
"dependencies": {
"trimkit": "^1.0.2"
}
} }

View File

@ -1,21 +0,0 @@
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
const babelConfig = {
env: {
es6: true,
browser: true
},
plugins: [],
presets: ['es2015-rollup']
};
export default {
entry: 'src/index.js',
moduleName: 'WorkerPortal',
plugins: [json(), babel(babelConfig)],
output: {
format: 'umd',
file: 'dist/worker-portal.js'
}
};

View File

@ -1,4 +1,4 @@
const { WorkerPortal } = require('../lib/index.js'); import { WorkerPortal } from '../src/index.js';
function FakeWorkerPair() { function FakeWorkerPair() {
let cbA = null; let cbA = null;

View File

@ -1,7 +0,0 @@
{
"spec_dir": "spec",
"spec_files": ["**/*[sS]pec.js"],
"helpers": ["helpers/**/*.js"],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@ -1,24 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner v2.5.2</title>
<link rel="shortcut icon" type="image/png" href="vendor/jasmine-2.5.2/jasmine_favicon.png">
<link rel="stylesheet" href="vendor/jasmine-2.5.2/jasmine.css">
<script src="vendor/jasmine-2.5.2/jasmine.js"></script>
<script src="vendor/jasmine-2.5.2/jasmine-html.js"></script>
<script src="vendor/jasmine-2.5.2/boot.js"></script>
<!-- include source files here... -->
<script src="dist/projector.js"></script>
<!-- include spec files here... -->
<script src="spec/projector.spec.js"></script>
</head>
<body>
</body>
</html>

View File

@ -1,39 +1,14 @@
{ {
"name": "projector", "name": "projector",
"version": "2.0.0", "version": "2.1.0",
"description": "A DOM-abstraction communicator", "description": "A DOM-abstraction communicator",
"main": "lib/index.js", "main": "src/index.js",
"jsnext:main": "src/index.js", "files": ["src"],
"files": ["dist", "lib", "src"], "scripts": {},
"scripts": {
"lint": "eslint src",
"clean": "rimraf dist lib",
"build:lib": "NODE_ENV=production babel src --presets=\"stage-0,es2015\" --out-dir lib",
"build:umd": "npm run build:lib && NODE_ENV=production rollup -c",
"build:umd:min":
"npm run build:umd && uglifyjs -m --screw-ie8 -c -o dist/projector.min.js dist/projector.js",
"build:umd:gzip":
"npm run build:umd:min && gzip -c9 dist/projector.min.js > dist/projector.min.js.gz",
"build": "npm run build:umd:gzip && ls -l dist/",
"prepublish": "npm run clean && npm run build",
"test": "npm run build:lib && jasmine --verbose"
},
"keywords": ["router"], "keywords": ["router"],
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)", "author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-preset-es2015": "6.18.0",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-stage-0": "6.16.0",
"jasmine": "^2.5.3",
"rimraf": "2.5.4",
"rollup-plugin-json": "2.1.0",
"rollup-plugin-babel": "^2.7.1",
"uglifyjs": "2.4.10"
},
"dependencies": { "dependencies": {
"trimkit": "^1.0.2" "trimkit": "^1.1.0"
} }
} }

View File

@ -1,21 +0,0 @@
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
const babelConfig = {
env: {
es6: true,
browser: true
},
plugins: [],
presets: ['stage-0', 'es2015-rollup']
};
export default {
entry: 'src/index.js',
moduleName: 'Projector',
plugins: [json(), babel(babelConfig)],
output: {
format: 'umd',
file: 'dist/projector.js'
}
};

View File

@ -1,4 +1,4 @@
const { CreateDocument } = require('../lib/document.js'); import { CreateDocument } from '../src/document.js';
describe('Document', () => { describe('Document', () => {
let doc; let doc;

View File

@ -1,3 +0,0 @@
self = window = {
location: {}
};

View File

@ -1,7 +0,0 @@
{
"spec_dir": "spec",
"spec_files": ["**/*.nondom.[sS]pec.js"],
"helpers": ["helpers/**/*.js"],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@ -1,4 +1,4 @@
import { isFunction } from 'trimkit'; import { isFunction } from '../node_modules/trimkit/src/index.js';
import { supportsPassive } from './utils.js'; import { supportsPassive } from './utils.js';
import { import {

View File

@ -1,146 +0,0 @@
/**
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
*/
(function() {
/**
* ## Require &amp; Instantiate
*
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
*/
window.jasmine = jasmineRequire.core(jasmineRequire);
/**
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
*/
jasmineRequire.html(jasmine);
/**
* Create the Jasmine environment. This is used to run all specs in a project.
*/
var env = jasmine.getEnv();
/**
* ## The Global Interface
*
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
*/
var jasmineInterface = jasmineRequire.interface(jasmine, env);
/**
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
*/
extend(window, jasmineInterface);
/**
* ## Runner Parameters
*
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
*/
var queryString = new jasmine.QueryString({
getWindowLocation: function() {
return window.location;
}
});
var catchingExceptions = queryString.getParam('catch');
env.catchExceptions(typeof catchingExceptions === 'undefined' ? true : catchingExceptions);
var throwingExpectationFailures = queryString.getParam('throwFailures');
env.throwOnExpectationFailure(throwingExpectationFailures);
var random = queryString.getParam('random');
env.randomizeTests(random);
var seed = queryString.getParam('seed');
if (seed) {
env.seed(seed);
}
/**
* ## Reporters
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
*/
var htmlReporter = new jasmine.HtmlReporter({
env: env,
onRaiseExceptionsClick: function() {
queryString.navigateWithNewParam('catch', !env.catchingExceptions());
},
onThrowExpectationsClick: function() {
queryString.navigateWithNewParam('throwFailures', !env.throwingExpectationFailures());
},
onRandomClick: function() {
queryString.navigateWithNewParam('random', !env.randomTests());
},
addToExistingQueryString: function(key, value) {
return queryString.fullStringWithNewParam(key, value);
},
getContainer: function() {
return document.body;
},
createElement: function() {
return document.createElement.apply(document, arguments);
},
createTextNode: function() {
return document.createTextNode.apply(document, arguments);
},
timer: new jasmine.Timer()
});
/**
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
*/
env.addReporter(jasmineInterface.jsApiReporter);
env.addReporter(htmlReporter);
/**
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
*/
var specFilter = new jasmine.HtmlSpecFilter({
filterString: function() {
return queryString.getParam('spec');
}
});
env.specFilter = function(spec) {
return specFilter.matches(spec.getFullName());
};
/**
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
*/
window.setTimeout = window.setTimeout;
window.setInterval = window.setInterval;
window.clearTimeout = window.clearTimeout;
window.clearInterval = window.clearInterval;
/**
* ## Execution
*
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
*/
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
htmlReporter.initialize();
env.execute();
};
/**
* Helper function for readability above.
*/
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
})();

View File

@ -1,196 +0,0 @@
/*
Copyright (c) 2008-2016 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
function getJasmineRequireObj() {
if (typeof module !== 'undefined' && module.exports) {
return exports;
} else {
window.jasmineRequire = window.jasmineRequire || {};
return window.jasmineRequire;
}
}
getJasmineRequireObj().console = function(jRequire, j$) {
j$.ConsoleReporter = jRequire.ConsoleReporter();
};
getJasmineRequireObj().ConsoleReporter = function() {
var noopTimer = {
start: function() {},
elapsed: function() {
return 0;
}
};
function ConsoleReporter(options) {
var print = options.print,
showColors = options.showColors || false,
onComplete = options.onComplete || function() {},
timer = options.timer || noopTimer,
specCount,
failureCount,
failedSpecs = [],
pendingCount,
ansi = {
green: '\x1B[32m',
red: '\x1B[31m',
yellow: '\x1B[33m',
none: '\x1B[0m'
},
failedSuites = [];
print('ConsoleReporter is deprecated and will be removed in a future version.');
this.jasmineStarted = function() {
specCount = 0;
failureCount = 0;
pendingCount = 0;
print('Started');
printNewline();
timer.start();
};
this.jasmineDone = function() {
printNewline();
for (var i = 0; i < failedSpecs.length; i++) {
specFailureDetails(failedSpecs[i]);
}
if (specCount > 0) {
printNewline();
var specCounts =
specCount +
' ' +
plural('spec', specCount) +
', ' +
failureCount +
' ' +
plural('failure', failureCount);
if (pendingCount) {
specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount);
}
print(specCounts);
} else {
print('No specs found');
}
printNewline();
var seconds = timer.elapsed() / 1000;
print('Finished in ' + seconds + ' ' + plural('second', seconds));
printNewline();
for (i = 0; i < failedSuites.length; i++) {
suiteFailureDetails(failedSuites[i]);
}
onComplete(failureCount === 0);
};
this.specDone = function(result) {
specCount++;
if (result.status == 'pending') {
pendingCount++;
print(colored('yellow', '*'));
return;
}
if (result.status == 'passed') {
print(colored('green', '.'));
return;
}
if (result.status == 'failed') {
failureCount++;
failedSpecs.push(result);
print(colored('red', 'F'));
}
};
this.suiteDone = function(result) {
if (result.failedExpectations && result.failedExpectations.length > 0) {
failureCount++;
failedSuites.push(result);
}
};
return this;
function printNewline() {
print('\n');
}
function colored(color, str) {
return showColors ? ansi[color] + str + ansi.none : str;
}
function plural(str, count) {
return count == 1 ? str : str + 's';
}
function repeat(thing, times) {
var arr = [];
for (var i = 0; i < times; i++) {
arr.push(thing);
}
return arr;
}
function indent(str, spaces) {
var lines = (str || '').split('\n');
var newArr = [];
for (var i = 0; i < lines.length; i++) {
newArr.push(repeat(' ', spaces).join('') + lines[i]);
}
return newArr.join('\n');
}
function specFailureDetails(result) {
printNewline();
print(result.fullName);
for (var i = 0; i < result.failedExpectations.length; i++) {
var failedExpectation = result.failedExpectations[i];
printNewline();
print(indent(failedExpectation.message, 2));
print(indent(failedExpectation.stack, 2));
}
printNewline();
}
function suiteFailureDetails(result) {
for (var i = 0; i < result.failedExpectations.length; i++) {
printNewline();
print(colored('red', 'An error was thrown in an afterAll'));
printNewline();
print(colored('red', 'AfterAll ' + result.failedExpectations[i].message));
}
printNewline();
}
}
return ConsoleReporter;
};

View File

@ -1,575 +0,0 @@
/*
Copyright (c) 2008-2016 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
jasmineRequire.html = function(j$) {
j$.ResultsNode = jasmineRequire.ResultsNode();
j$.HtmlReporter = jasmineRequire.HtmlReporter(j$);
j$.QueryString = jasmineRequire.QueryString();
j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter();
};
jasmineRequire.HtmlReporter = function(j$) {
var noopTimer = {
start: function() {},
elapsed: function() {
return 0;
}
};
function HtmlReporter(options) {
var env = options.env || {},
getContainer = options.getContainer,
createElement = options.createElement,
createTextNode = options.createTextNode,
onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {},
onThrowExpectationsClick = options.onThrowExpectationsClick || function() {},
onRandomClick = options.onRandomClick || function() {},
addToExistingQueryString = options.addToExistingQueryString || defaultQueryString,
timer = options.timer || noopTimer,
results = [],
specsExecuted = 0,
failureCount = 0,
pendingSpecCount = 0,
htmlReporterMain,
symbols,
failedSuites = [];
this.initialize = function() {
clearPrior();
htmlReporterMain = createDom(
'div',
{ className: 'jasmine_html-reporter' },
createDom(
'div',
{ className: 'jasmine-banner' },
createDom('a', {
className: 'jasmine-title',
href: 'http://jasmine.github.io/',
target: '_blank'
}),
createDom('span', { className: 'jasmine-version' }, j$.version)
),
createDom('ul', { className: 'jasmine-symbol-summary' }),
createDom('div', { className: 'jasmine-alert' }),
createDom(
'div',
{ className: 'jasmine-results' },
createDom('div', { className: 'jasmine-failures' })
)
);
getContainer().appendChild(htmlReporterMain);
};
var totalSpecsDefined;
this.jasmineStarted = function(options) {
totalSpecsDefined = options.totalSpecsDefined || 0;
timer.start();
};
var summary = createDom('div', { className: 'jasmine-summary' });
var topResults = new j$.ResultsNode({}, '', null),
currentParent = topResults;
this.suiteStarted = function(result) {
currentParent.addChild(result, 'suite');
currentParent = currentParent.last();
};
this.suiteDone = function(result) {
if (result.status == 'failed') {
failedSuites.push(result);
}
if (currentParent == topResults) {
return;
}
currentParent = currentParent.parent;
};
this.specStarted = function(result) {
currentParent.addChild(result, 'spec');
};
var failures = [];
this.specDone = function(result) {
if (
noExpectations(result) &&
typeof console !== 'undefined' &&
typeof console.error !== 'undefined'
) {
console.error("Spec '" + result.fullName + "' has no expectations.");
}
if (result.status != 'disabled') {
specsExecuted++;
}
if (!symbols) {
symbols = find('.jasmine-symbol-summary');
}
symbols.appendChild(
createDom('li', {
className: noExpectations(result) ? 'jasmine-empty' : 'jasmine-' + result.status,
id: 'spec_' + result.id,
title: result.fullName
})
);
if (result.status == 'failed') {
failureCount++;
var failure = createDom(
'div',
{ className: 'jasmine-spec-detail jasmine-failed' },
createDom(
'div',
{ className: 'jasmine-description' },
createDom('a', { title: result.fullName, href: specHref(result) }, result.fullName)
),
createDom('div', { className: 'jasmine-messages' })
);
var messages = failure.childNodes[1];
for (var i = 0; i < result.failedExpectations.length; i++) {
var expectation = result.failedExpectations[i];
messages.appendChild(
createDom('div', { className: 'jasmine-result-message' }, expectation.message)
);
messages.appendChild(
createDom('div', { className: 'jasmine-stack-trace' }, expectation.stack)
);
}
failures.push(failure);
}
if (result.status == 'pending') {
pendingSpecCount++;
}
};
this.jasmineDone = function(doneResult) {
var banner = find('.jasmine-banner');
var alert = find('.jasmine-alert');
var order = doneResult && doneResult.order;
alert.appendChild(
createDom(
'span',
{ className: 'jasmine-duration' },
'finished in ' + timer.elapsed() / 1000 + 's'
)
);
banner.appendChild(
createDom(
'div',
{ className: 'jasmine-run-options' },
createDom('span', { className: 'jasmine-trigger' }, 'Options'),
createDom(
'div',
{ className: 'jasmine-payload' },
createDom(
'div',
{ className: 'jasmine-exceptions' },
createDom('input', {
className: 'jasmine-raise',
id: 'jasmine-raise-exceptions',
type: 'checkbox'
}),
createDom(
'label',
{ className: 'jasmine-label', for: 'jasmine-raise-exceptions' },
'raise exceptions'
)
),
createDom(
'div',
{ className: 'jasmine-throw-failures' },
createDom('input', {
className: 'jasmine-throw',
id: 'jasmine-throw-failures',
type: 'checkbox'
}),
createDom(
'label',
{ className: 'jasmine-label', for: 'jasmine-throw-failures' },
'stop spec on expectation failure'
)
),
createDom(
'div',
{ className: 'jasmine-random-order' },
createDom('input', {
className: 'jasmine-random',
id: 'jasmine-random-order',
type: 'checkbox'
}),
createDom(
'label',
{ className: 'jasmine-label', for: 'jasmine-random-order' },
'run tests in random order'
)
)
)
)
);
var raiseCheckbox = find('#jasmine-raise-exceptions');
raiseCheckbox.checked = !env.catchingExceptions();
raiseCheckbox.onclick = onRaiseExceptionsClick;
var throwCheckbox = find('#jasmine-throw-failures');
throwCheckbox.checked = env.throwingExpectationFailures();
throwCheckbox.onclick = onThrowExpectationsClick;
var randomCheckbox = find('#jasmine-random-order');
randomCheckbox.checked = env.randomTests();
randomCheckbox.onclick = onRandomClick;
var optionsMenu = find('.jasmine-run-options'),
optionsTrigger = optionsMenu.querySelector('.jasmine-trigger'),
optionsPayload = optionsMenu.querySelector('.jasmine-payload'),
isOpen = /\bjasmine-open\b/;
optionsTrigger.onclick = function() {
if (isOpen.test(optionsPayload.className)) {
optionsPayload.className = optionsPayload.className.replace(isOpen, '');
} else {
optionsPayload.className += ' jasmine-open';
}
};
if (specsExecuted < totalSpecsDefined) {
var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all';
var skippedLink = order && order.random ? '?random=true' : '?';
alert.appendChild(
createDom(
'span',
{ className: 'jasmine-bar jasmine-skipped' },
createDom('a', { href: skippedLink, title: 'Run all specs' }, skippedMessage)
)
);
}
var statusBarMessage = '';
var statusBarClassName = 'jasmine-bar ';
if (totalSpecsDefined > 0) {
statusBarMessage +=
pluralize('spec', specsExecuted) + ', ' + pluralize('failure', failureCount);
if (pendingSpecCount) {
statusBarMessage += ', ' + pluralize('pending spec', pendingSpecCount);
}
statusBarClassName += failureCount > 0 ? 'jasmine-failed' : 'jasmine-passed';
} else {
statusBarClassName += 'jasmine-skipped';
statusBarMessage += 'No specs found';
}
var seedBar;
if (order && order.random) {
seedBar = createDom(
'span',
{ className: 'jasmine-seed-bar' },
', randomized with seed ',
createDom(
'a',
{ title: 'randomized with seed ' + order.seed, href: seedHref(order.seed) },
order.seed
)
);
}
alert.appendChild(
createDom('span', { className: statusBarClassName }, statusBarMessage, seedBar)
);
var errorBarClassName = 'jasmine-bar jasmine-errored';
var errorBarMessagePrefix = 'AfterAll ';
for (var i = 0; i < failedSuites.length; i++) {
var failedSuite = failedSuites[i];
for (var j = 0; j < failedSuite.failedExpectations.length; j++) {
alert.appendChild(
createDom(
'span',
{ className: errorBarClassName },
errorBarMessagePrefix + failedSuite.failedExpectations[j].message
)
);
}
}
var globalFailures = (doneResult && doneResult.failedExpectations) || [];
for (i = 0; i < globalFailures.length; i++) {
var failure = globalFailures[i];
alert.appendChild(
createDom('span', { className: errorBarClassName }, errorBarMessagePrefix + failure.message)
);
}
var results = find('.jasmine-results');
results.appendChild(summary);
summaryList(topResults, summary);
function summaryList(resultsTree, domParent) {
var specListNode;
for (var i = 0; i < resultsTree.children.length; i++) {
var resultNode = resultsTree.children[i];
if (resultNode.type == 'suite') {
var suiteListNode = createDom(
'ul',
{ className: 'jasmine-suite', id: 'suite-' + resultNode.result.id },
createDom(
'li',
{ className: 'jasmine-suite-detail' },
createDom('a', { href: specHref(resultNode.result) }, resultNode.result.description)
)
);
summaryList(resultNode, suiteListNode);
domParent.appendChild(suiteListNode);
}
if (resultNode.type == 'spec') {
if (domParent.getAttribute('class') != 'jasmine-specs') {
specListNode = createDom('ul', { className: 'jasmine-specs' });
domParent.appendChild(specListNode);
}
var specDescription = resultNode.result.description;
if (noExpectations(resultNode.result)) {
specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription;
}
if (resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') {
specDescription =
specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason;
}
specListNode.appendChild(
createDom(
'li',
{
className: 'jasmine-' + resultNode.result.status,
id: 'spec-' + resultNode.result.id
},
createDom('a', { href: specHref(resultNode.result) }, specDescription)
)
);
}
}
}
if (failures.length) {
alert.appendChild(
createDom(
'span',
{ className: 'jasmine-menu jasmine-bar jasmine-spec-list' },
createDom('span', {}, 'Spec List | '),
createDom('a', { className: 'jasmine-failures-menu', href: '#' }, 'Failures')
)
);
alert.appendChild(
createDom(
'span',
{ className: 'jasmine-menu jasmine-bar jasmine-failure-list' },
createDom('a', { className: 'jasmine-spec-list-menu', href: '#' }, 'Spec List'),
createDom('span', {}, ' | Failures ')
)
);
find('.jasmine-failures-menu').onclick = function() {
setMenuModeTo('jasmine-failure-list');
};
find('.jasmine-spec-list-menu').onclick = function() {
setMenuModeTo('jasmine-spec-list');
};
setMenuModeTo('jasmine-failure-list');
var failureNode = find('.jasmine-failures');
for (i = 0; i < failures.length; i++) {
failureNode.appendChild(failures[i]);
}
}
};
return this;
function find(selector) {
return getContainer().querySelector('.jasmine_html-reporter ' + selector);
}
function clearPrior() {
// return the reporter
var oldReporter = find('');
if (oldReporter) {
getContainer().removeChild(oldReporter);
}
}
function createDom(type, attrs, childrenVarArgs) {
var el = createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(createTextNode(child));
} else {
if (child) {
el.appendChild(child);
}
}
}
for (var attr in attrs) {
if (attr == 'className') {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
}
function pluralize(singular, count) {
var word = count == 1 ? singular : singular + 's';
return '' + count + ' ' + word;
}
function specHref(result) {
return addToExistingQueryString('spec', result.fullName);
}
function seedHref(seed) {
return addToExistingQueryString('seed', seed);
}
function defaultQueryString(key, value) {
return '?' + key + '=' + value;
}
function setMenuModeTo(mode) {
htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode);
}
function noExpectations(result) {
return (
result.failedExpectations.length + result.passedExpectations.length === 0 &&
result.status === 'passed'
);
}
}
return HtmlReporter;
};
jasmineRequire.HtmlSpecFilter = function() {
function HtmlSpecFilter(options) {
var filterString =
options &&
options.filterString() &&
options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
var filterPattern = new RegExp(filterString);
this.matches = function(specName) {
return filterPattern.test(specName);
};
}
return HtmlSpecFilter;
};
jasmineRequire.ResultsNode = function() {
function ResultsNode(result, type, parent) {
this.result = result;
this.type = type;
this.parent = parent;
this.children = [];
this.addChild = function(result, type) {
this.children.push(new ResultsNode(result, type, this));
};
this.last = function() {
return this.children[this.children.length - 1];
};
}
return ResultsNode;
};
jasmineRequire.QueryString = function() {
function QueryString(options) {
this.navigateWithNewParam = function(key, value) {
options.getWindowLocation().search = this.fullStringWithNewParam(key, value);
};
this.fullStringWithNewParam = function(key, value) {
var paramMap = queryStringToParamMap();
paramMap[key] = value;
return toQueryString(paramMap);
};
this.getParam = function(key) {
return queryStringToParamMap()[key];
};
return this;
function toQueryString(paramMap) {
var qStrPairs = [];
for (var prop in paramMap) {
qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop]));
}
return '?' + qStrPairs.join('&');
}
function queryStringToParamMap() {
var paramStr = options.getWindowLocation().search.substring(1),
params = [],
paramMap = {};
if (paramStr.length > 0) {
params = paramStr.split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
var value = decodeURIComponent(p[1]);
if (value === 'true' || value === 'false') {
value = JSON.parse(value);
}
paramMap[decodeURIComponent(p[0])] = value;
}
}
return paramMap;
}
}
return QueryString;
};

File diff suppressed because it is too large Load Diff

View File

@ -1,38 +1,16 @@
{ {
"name": "router", "name": "router",
"version": "2.0.0", "version": "2.1.0",
"description": "A slim and unopinionated router", "description": "A slim and unopinionated router",
"main": "lib/index.js", "main": "src/index.js",
"jsnext:main": "src/index.js", "files": ["src"],
"files": ["dist", "lib", "src"],
"scripts": { "scripts": {
"lint": "eslint src", "test": "node ../../bin/runTests.js ./"
"clean": "rimraf dist lib",
"build:lib": "NODE_ENV=production babel src --presets=\"stage-0,es2015\" --out-dir lib",
"build:umd": "npm run build:lib && NODE_ENV=production rollup -c",
"build:umd:min":
"npm run build:umd && uglifyjs -m --screw-ie8 -c -o dist/router.min.js dist/router.js",
"build:umd:gzip": "npm run build:umd:min && gzip -c9 dist/router.min.js > dist/router.min.js.gz",
"build": "npm run build:umd:gzip && ls -l dist/",
"prepublish": "npm run clean && npm run build",
"test": "npm run build:lib && jasmine --verbose"
}, },
"keywords": ["router"], "keywords": ["router"],
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)", "author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-preset-es2015": "6.18.0",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-stage-0": "6.16.0",
"jasmine": "^2.5.3",
"rimraf": "2.5.4",
"rollup-plugin-json": "2.1.0",
"rollup-plugin-babel": "^2.7.1",
"uglifyjs": "2.4.10"
},
"dependencies": { "dependencies": {
"trimkit": "^1.0.2" "trimkit": "^1.1.0"
} }
} }

View File

@ -1,21 +0,0 @@
import json from 'rollup-plugin-json';
import babel from 'rollup-plugin-babel';
const babelConfig = {
env: {
es6: true,
browser: true
},
plugins: [],
presets: ['stage-0', 'es2015-rollup']
};
export default {
entry: 'src/index.js',
moduleName: 'Router',
plugins: [json(), babel(babelConfig)],
output: {
format: 'umd',
file: 'dist/router.js'
}
};

View File

@ -1,3 +0,0 @@
self = window = {
location: {}
};

View File

@ -1,4 +1,4 @@
const { Router } = require('../lib/index.js'); import { Router } from '../src/index.js';
describe('router.href builds urls', () => { describe('router.href builds urls', () => {
const router = Router([ const router = Router([

View File

@ -1,7 +0,0 @@
{
"spec_dir": "spec",
"spec_files": ["**/*[sS]pec.js"],
"helpers": ["helpers/**/*.js"],
"stopSpecOnExpectationFailure": false,
"random": false
}

View File

@ -1,4 +1,4 @@
import { isFunction, isUndefined, Null, ObjectKeys } from 'trimkit'; import { isFunction, isUndefined, Null, ObjectKeys } from '../node_modules/trimkit/src/index.js';
const VARMATCH_RE = /:([^\/]+)/g; const VARMATCH_RE = /:([^\/]+)/g;
const ROUTEELEMENT_RE = /^[^\/]+$/; const ROUTEELEMENT_RE = /^[^\/]+$/;

View File

@ -1,33 +1,10 @@
{ {
"name": "trimkit", "name": "trimkit",
"version": "1.0.2", "version": "1.1.0",
"description": "Javascript and DOM abstractions for smaller minifiable code", "description": "Javascript and DOM abstractions for smaller minifiable code",
"main": "lib/index.js", "main": "src/index.js",
"jsnext:main": "src/index.js", "files": ["src"],
"files": ["dist", "lib", "src"],
"scripts": {
"lint": "eslint src",
"clean": "rimraf dist lib",
"build:lib": "NODE_ENV=production babel src --presets=\"stage-0,es2015\" --out-dir lib",
"build:umd": "npm run build:lib && NODE_ENV=production rollup -c",
"build:umd:min":
"npm run build:umd && uglifyjs -m --screw-ie8 -c -o dist/trimkit.min.js dist/trimkit.js",
"build:umd:gzip":
"npm run build:umd:min && gzip -c9 dist/trimkit.min.js > dist/trimkit.min.js.gz",
"build": "npm run build:umd:gzip && ls -l dist/",
"prepublish": "npm run clean && npm run build"
},
"keywords": ["javascript"], "keywords": ["javascript"],
"author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)", "author": "Timothy Farrell <tim@thecookiejar.me> (https://github.com/explorigin)",
"license": "Apache-2.0", "license": "Apache-2.0"
"devDependencies": {
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-preset-es2015": "6.18.0",
"babel-preset-es2015-rollup": "3.0.0",
"babel-preset-stage-0": "6.16.0",
"rimraf": "2.5.4",
"rollup-plugin-json": "2.1.0",
"uglifyjs": "2.4.10"
}
} }

View File

@ -1,11 +0,0 @@
import json from 'rollup-plugin-json';
export default {
entry: 'src/index.js',
moduleName: 'Trimkit',
plugins: [json()],
output: {
format: 'umd',
file: 'dist/trimkit.js'
}
};

153
vendor/jasmine/boot.js vendored Normal file
View File

@ -0,0 +1,153 @@
/**
Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
The location of `boot.js` can be specified and/or overridden in `jasmine.yml`.
[jasmine-gem]: http://github.com/pivotal/jasmine-gem
*/
(function() {
/**
* ## Require &amp; Instantiate
*
* Require Jasmine's core files. Specifically, this requires and attaches all of Jasmine's code to the `jasmine` reference.
*/
window.jasmine = jasmineRequire.core(jasmineRequire);
/**
* Since this is being run in a browser and the results should populate to an HTML page, require the HTML-specific Jasmine code, injecting the same reference.
*/
jasmineRequire.html(jasmine);
/**
* Create the Jasmine environment. This is used to run all specs in a project.
*/
var env = jasmine.getEnv();
/**
* ## The Global Interface
*
* Build up the functions that will be exposed as the Jasmine public interface. A project can customize, rename or alias any of these functions as desired, provided the implementation remains unchanged.
*/
var jasmineInterface = jasmineRequire.interface(jasmine, env);
/**
* Add all of the Jasmine global/public interface to the global scope, so a project can use the public interface directly. For example, calling `describe` in specs instead of `jasmine.getEnv().describe`.
*/
extend(window, jasmineInterface);
/**
* ## Runner Parameters
*
* More browser specific code - wrap the query string in an object and to allow for getting/setting parameters from the runner user interface.
*/
var queryString = new jasmine.QueryString({
getWindowLocation: function() { return window.location; }
});
var filterSpecs = !!queryString.getParam("spec");
var stoppingOnSpecFailure = queryString.getParam("failFast");
env.stopOnSpecFailure(stoppingOnSpecFailure);
var throwingExpectationFailures = queryString.getParam("throwFailures");
env.throwOnExpectationFailure(throwingExpectationFailures);
var random = queryString.getParam("random");
if (random !== undefined && random !== "") {
env.randomizeTests(random);
}
var seed = queryString.getParam("seed");
if (seed) {
env.seed(seed);
}
/**
* ## Reporters
* The `HtmlReporter` builds all of the HTML UI for the runner page. This reporter paints the dots, stars, and x's for specs, as well as all spec names and all failures (if any).
*/
const timer = new jasmine.Timer();
var htmlReporter = new jasmine.HtmlReporter({
env: env,
navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); },
addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); },
getContainer: function() { return document.body; },
createElement: function() { return document.createElement.apply(document, arguments); },
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
timer,
filterSpecs: filterSpecs
});
/**
* The `jsApiReporter` also receives spec results, and is used by any environment that needs to extract the results from JavaScript.
*/
env.addReporter(jasmineInterface.jsApiReporter);
const report = method => result => {
// console[method](result.description);
console.log(JSON.stringify(Object.assign({method}, result)));
}
env.addReporter({
jasmineStarted: function(result) {
console.log(`${result.totalSpecsDefined} specs${result.order.random ? `, randomized with seed ${result.order.seed}` : ''}`);
},
suiteStarted: report('group'),
specDone: report('log'),
suiteDone: report('groupEnd'),
jasmineDone: function(result) {
console.log(`${result.overallStatus} after ${timer.elapsed() / 1000}s`);
},
});
env.addReporter(htmlReporter);
/**
* Filter which specs will be run by matching the start of the full name against the `spec` query param.
*/
var specFilter = new jasmine.HtmlSpecFilter({
filterString: function() { return queryString.getParam("spec"); }
});
env.specFilter = function(spec) {
return specFilter.matches(spec.getFullName());
};
/**
* Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack.
*/
window.setTimeout = window.setTimeout;
window.setInterval = window.setInterval;
window.clearTimeout = window.clearTimeout;
window.clearInterval = window.clearInterval;
/**
* ## Execution
*
* Replace the browser window's `onload`, ensure it's called, and then run all of the loaded specs. This includes initializing the `HtmlReporter` instance and then executing the loaded Jasmine environment. All of this will happen after all of the specs are loaded.
*/
var currentWindowOnload = window.onload;
window.onload = function() {
if (currentWindowOnload) {
currentWindowOnload();
}
htmlReporter.initialize();
env.execute();
};
/**
* Helper function for readability above.
*/
function extend(destination, source) {
for (var property in source) destination[property] = source[property];
return destination;
}
}());

601
vendor/jasmine/jasmine-html.js vendored Normal file
View File

@ -0,0 +1,601 @@
/*
Copyright (c) 2008-2018 Pivotal Labs
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
jasmineRequire.html = function(j$) {
j$.ResultsNode = jasmineRequire.ResultsNode();
j$.HtmlReporter = jasmineRequire.HtmlReporter(j$);
j$.QueryString = jasmineRequire.QueryString();
j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter();
};
jasmineRequire.HtmlReporter = function(j$) {
var noopTimer = {
start: function() {},
elapsed: function() { return 0; }
};
function ResultsStateBuilder() {
this.topResults = new j$.ResultsNode({}, '', null);
this.currentParent = this.topResults;
this.specsExecuted = 0;
this.failureCount = 0;
this.pendingSpecCount = 0;
}
ResultsStateBuilder.prototype.suiteStarted = function(result) {
this.currentParent.addChild(result, 'suite');
this.currentParent = this.currentParent.last();
};
ResultsStateBuilder.prototype.suiteDone = function(result) {
this.currentParent.updateResult(result);
if (this.currentParent !== this.topResults) {
this.currentParent = this.currentParent.parent;
}
if (result.status === 'failed') {
this.failureCount++;
}
};
ResultsStateBuilder.prototype.specStarted = function(result) {
};
ResultsStateBuilder.prototype.specDone = function(result) {
this.currentParent.addChild(result, 'spec');
if (result.status !== 'excluded') {
this.specsExecuted++;
}
if (result.status === 'failed') {
this.failureCount++;
}
if (result.status == 'pending') {
this.pendingSpecCount++;
}
};
function HtmlReporter(options) {
var env = options.env || {},
getContainer = options.getContainer,
createElement = options.createElement,
createTextNode = options.createTextNode,
navigateWithNewParam = options.navigateWithNewParam || function() {},
addToExistingQueryString = options.addToExistingQueryString || defaultQueryString,
filterSpecs = options.filterSpecs,
timer = options.timer || noopTimer,
htmlReporterMain,
symbols,
deprecationWarnings = [];
this.initialize = function() {
clearPrior();
htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'},
createDom('div', {className: 'jasmine-banner'},
createDom('a', {className: 'jasmine-title', href: 'http://jasmine.github.io/', target: '_blank'}),
createDom('span', {className: 'jasmine-version'}, j$.version)
),
createDom('ul', {className: 'jasmine-symbol-summary'}),
createDom('div', {className: 'jasmine-alert'}),
createDom('div', {className: 'jasmine-results'},
createDom('div', {className: 'jasmine-failures'})
)
);
getContainer().appendChild(htmlReporterMain);
};
var totalSpecsDefined;
this.jasmineStarted = function(options) {
totalSpecsDefined = options.totalSpecsDefined || 0;
timer.start();
};
var summary = createDom('div', {className: 'jasmine-summary'});
var stateBuilder = new ResultsStateBuilder();
this.suiteStarted = function(result) {
stateBuilder.suiteStarted(result);
};
this.suiteDone = function(result) {
stateBuilder.suiteDone(result);
if (result.status === 'failed') {
failures.push(failureDom(result));
}
addDeprecationWarnings(result);
};
this.specStarted = function(result) {
stateBuilder.specStarted(result);
};
var failures = [];
this.specDone = function(result) {
stateBuilder.specDone(result);
if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') {
console.error('Spec \'' + result.fullName + '\' has no expectations.');
}
if (!symbols){
symbols = find('.jasmine-symbol-summary');
}
symbols.appendChild(createDom('li', {
className: noExpectations(result) ? 'jasmine-empty' : 'jasmine-' + result.status,
id: 'spec_' + result.id,
title: result.fullName
}
));
if (result.status === 'failed') {
failures.push(failureDom(result));
}
addDeprecationWarnings(result);
};
this.jasmineDone = function(doneResult) {
var banner = find('.jasmine-banner');
var alert = find('.jasmine-alert');
var order = doneResult && doneResult.order;
alert.appendChild(createDom('span', {className: 'jasmine-duration'}, 'finished in ' + timer.elapsed() / 1000 + 's'));
banner.appendChild(optionsMenu(env));
if (stateBuilder.specsExecuted < totalSpecsDefined) {
var skippedMessage = 'Ran ' + stateBuilder.specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all';
var skippedLink = addToExistingQueryString('spec', '');
alert.appendChild(
createDom('span', {className: 'jasmine-bar jasmine-skipped'},
createDom('a', {href: skippedLink, title: 'Run all specs'}, skippedMessage)
)
);
}
var statusBarMessage = '';
var statusBarClassName = 'jasmine-overall-result jasmine-bar ';
var globalFailures = (doneResult && doneResult.failedExpectations) || [];
var failed = stateBuilder.failureCount + globalFailures.length > 0;
if (totalSpecsDefined > 0 || failed) {
statusBarMessage += pluralize('spec', stateBuilder.specsExecuted) + ', ' + pluralize('failure', stateBuilder.failureCount);
if (stateBuilder.pendingSpecCount) { statusBarMessage += ', ' + pluralize('pending spec', stateBuilder.pendingSpecCount); }
}
if (doneResult.overallStatus === 'passed') {
statusBarClassName += ' jasmine-passed ';
} else if (doneResult.overallStatus === 'incomplete') {
statusBarClassName += ' jasmine-incomplete ';
statusBarMessage = 'Incomplete: ' + doneResult.incompleteReason + ', ' + statusBarMessage;
} else {
statusBarClassName += ' jasmine-failed ';
}
var seedBar;
if (order && order.random) {
seedBar = createDom('span', {className: 'jasmine-seed-bar'},
', randomized with seed ',
createDom('a', {title: 'randomized with seed ' + order.seed, href: seedHref(order.seed)}, order.seed)
);
}
alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage, seedBar));
var errorBarClassName = 'jasmine-bar jasmine-errored';
var afterAllMessagePrefix = 'AfterAll ';
for(i = 0; i < globalFailures.length; i++) {
alert.appendChild(createDom('span', {className: errorBarClassName}, globalFailureMessage(globalFailures[i])));
}
function globalFailureMessage(failure) {
if (failure.globalErrorType === 'load') {
var prefix = 'Error during loading: ' + failure.message;
if (failure.filename) {
return prefix + ' in ' + failure.filename + ' line ' + failure.lineno;
} else {
return prefix;
}
} else {
return afterAllMessagePrefix + failure.message;
}
}
addDeprecationWarnings(doneResult);
var warningBarClassName = 'jasmine-bar jasmine-warning';
for(i = 0; i < deprecationWarnings.length; i++) {
var warning = deprecationWarnings[i];
alert.appendChild(createDom('span', {className: warningBarClassName}, 'DEPRECATION: ' + warning));
}
var results = find('.jasmine-results');
results.appendChild(summary);
summaryList(stateBuilder.topResults, summary);
if (failures.length) {
alert.appendChild(
createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-spec-list'},
createDom('span', {}, 'Spec List | '),
createDom('a', {className: 'jasmine-failures-menu', href: '#'}, 'Failures')));
alert.appendChild(
createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-failure-list'},
createDom('a', {className: 'jasmine-spec-list-menu', href: '#'}, 'Spec List'),
createDom('span', {}, ' | Failures ')));
find('.jasmine-failures-menu').onclick = function() {
setMenuModeTo('jasmine-failure-list');
};
find('.jasmine-spec-list-menu').onclick = function() {
setMenuModeTo('jasmine-spec-list');
};
setMenuModeTo('jasmine-failure-list');
var failureNode = find('.jasmine-failures');
for (i = 0; i < failures.length; i++) {
failureNode.appendChild(failures[i]);
}
}
};
return this;
function failureDom(result) {
var failure =
createDom('div', {className: 'jasmine-spec-detail jasmine-failed'},
failureDescription(result, stateBuilder.currentParent),
createDom('div', {className: 'jasmine-messages'})
);
var messages = failure.childNodes[1];
for (var i = 0; i < result.failedExpectations.length; i++) {
var expectation = result.failedExpectations[i];
messages.appendChild(createDom('div', {className: 'jasmine-result-message'}, expectation.message));
messages.appendChild(createDom('div', {className: 'jasmine-stack-trace'}, expectation.stack));
}
return failure;
}
function summaryList(resultsTree, domParent) {
var specListNode;
for (var i = 0; i < resultsTree.children.length; i++) {
var resultNode = resultsTree.children[i];
if (filterSpecs && !hasActiveSpec(resultNode)) {
continue;
}
if (resultNode.type === 'suite') {
var suiteListNode = createDom('ul', {className: 'jasmine-suite', id: 'suite-' + resultNode.result.id},
createDom('li', {className: 'jasmine-suite-detail jasmine-' + resultNode.result.status},
createDom('a', {href: specHref(resultNode.result)}, resultNode.result.description)
)
);
summaryList(resultNode, suiteListNode);
domParent.appendChild(suiteListNode);
}
if (resultNode.type === 'spec') {
if (domParent.getAttribute('class') !== 'jasmine-specs') {
specListNode = createDom('ul', {className: 'jasmine-specs'});
domParent.appendChild(specListNode);
}
var specDescription = resultNode.result.description;
if(noExpectations(resultNode.result)) {
specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription;
}
if(resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') {
specDescription = specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason;
}
specListNode.appendChild(
createDom('li', {
className: 'jasmine-' + resultNode.result.status,
id: 'spec-' + resultNode.result.id
},
createDom('a', {href: specHref(resultNode.result)}, specDescription)
)
);
}
}
}
function optionsMenu(env) {
var optionsMenuDom = createDom('div', { className: 'jasmine-run-options' },
createDom('span', { className: 'jasmine-trigger' }, 'Options'),
createDom('div', { className: 'jasmine-payload' },
createDom('div', { className: 'jasmine-stop-on-failure' },
createDom('input', {
className: 'jasmine-fail-fast',
id: 'jasmine-fail-fast',
type: 'checkbox'
}),
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-fail-fast' }, 'stop execution on spec failure')),
createDom('div', { className: 'jasmine-throw-failures' },
createDom('input', {
className: 'jasmine-throw',
id: 'jasmine-throw-failures',
type: 'checkbox'
}),
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-throw-failures' }, 'stop spec on expectation failure')),
createDom('div', { className: 'jasmine-random-order' },
createDom('input', {
className: 'jasmine-random',
id: 'jasmine-random-order',
type: 'checkbox'
}),
createDom('label', { className: 'jasmine-label', 'for': 'jasmine-random-order' }, 'run tests in random order'))
)
);
var failFastCheckbox = optionsMenuDom.querySelector('#jasmine-fail-fast');
failFastCheckbox.checked = env.stoppingOnSpecFailure();
failFastCheckbox.onclick = function() {
navigateWithNewParam('failFast', !env.stoppingOnSpecFailure());
};
var throwCheckbox = optionsMenuDom.querySelector('#jasmine-throw-failures');
throwCheckbox.checked = env.throwingExpectationFailures();
throwCheckbox.onclick = function() {
navigateWithNewParam('throwFailures', !env.throwingExpectationFailures());
};
var randomCheckbox = optionsMenuDom.querySelector('#jasmine-random-order');
randomCheckbox.checked = env.randomTests();
randomCheckbox.onclick = function() {
navigateWithNewParam('random', !env.randomTests());
};
var optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger'),
optionsPayload = optionsMenuDom.querySelector('.jasmine-payload'),
isOpen = /\bjasmine-open\b/;
optionsTrigger.onclick = function() {
if (isOpen.test(optionsPayload.className)) {
optionsPayload.className = optionsPayload.className.replace(isOpen, '');
} else {
optionsPayload.className += ' jasmine-open';
}
};
return optionsMenuDom;
}
function failureDescription(result, suite) {
var wrapper = createDom('div', {className: 'jasmine-description'},
createDom('a', {title: result.description, href: specHref(result)}, result.description)
);
var suiteLink;
while (suite && suite.parent) {
wrapper.insertBefore(createTextNode(' > '), wrapper.firstChild);
suiteLink = createDom('a', {href: suiteHref(suite)}, suite.result.description);
wrapper.insertBefore(suiteLink, wrapper.firstChild);
suite = suite.parent;
}
return wrapper;
}
function suiteHref(suite) {
var els = [];
while (suite && suite.parent) {
els.unshift(suite.result.description);
suite = suite.parent;
}
return addToExistingQueryString('spec', els.join(' '));
}
function addDeprecationWarnings(result) {
if (result && result.deprecationWarnings) {
for(var i = 0; i < result.deprecationWarnings.length; i++) {
var warning = result.deprecationWarnings[i].message;
if (!j$.util.arrayContains(warning)) {
deprecationWarnings.push(warning);
}
}
}
}
function find(selector) {
return getContainer().querySelector('.jasmine_html-reporter ' + selector);
}
function clearPrior() {
// return the reporter
var oldReporter = find('');
if(oldReporter) {
getContainer().removeChild(oldReporter);
}
}
function createDom(type, attrs, childrenVarArgs) {
var el = createElement(type);
for (var i = 2; i < arguments.length; i++) {
var child = arguments[i];
if (typeof child === 'string') {
el.appendChild(createTextNode(child));
} else {
if (child) {
el.appendChild(child);
}
}
}
for (var attr in attrs) {
if (attr == 'className') {
el[attr] = attrs[attr];
} else {
el.setAttribute(attr, attrs[attr]);
}
}
return el;
}
function pluralize(singular, count) {
var word = (count == 1 ? singular : singular + 's');
return '' + count + ' ' + word;
}
function specHref(result) {
return addToExistingQueryString('spec', result.fullName);
}
function seedHref(seed) {
return addToExistingQueryString('seed', seed);
}
function defaultQueryString(key, value) {
return '?' + key + '=' + value;
}
function setMenuModeTo(mode) {
htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode);
}
function noExpectations(result) {
return (result.failedExpectations.length + result.passedExpectations.length) === 0 &&
result.status === 'passed';
}
function hasActiveSpec(resultNode) {
if (resultNode.type == 'spec' && resultNode.result.status != 'excluded') {
return true;
}
if (resultNode.type == 'suite') {
for (var i = 0, j = resultNode.children.length; i < j; i++) {
if (hasActiveSpec(resultNode.children[i])) {
return true;
}
}
}
}
}
return HtmlReporter;
};
jasmineRequire.HtmlSpecFilter = function() {
function HtmlSpecFilter(options) {
var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
var filterPattern = new RegExp(filterString);
this.matches = function(specName) {
return filterPattern.test(specName);
};
}
return HtmlSpecFilter;
};
jasmineRequire.ResultsNode = function() {
function ResultsNode(result, type, parent) {
this.result = result;
this.type = type;
this.parent = parent;
this.children = [];
this.addChild = function(result, type) {
this.children.push(new ResultsNode(result, type, this));
};
this.last = function() {
return this.children[this.children.length - 1];
};
this.updateResult = function(result) {
this.result = result;
};
}
return ResultsNode;
};
jasmineRequire.QueryString = function() {
function QueryString(options) {
this.navigateWithNewParam = function(key, value) {
options.getWindowLocation().search = this.fullStringWithNewParam(key, value);
};
this.fullStringWithNewParam = function(key, value) {
var paramMap = queryStringToParamMap();
paramMap[key] = value;
return toQueryString(paramMap);
};
this.getParam = function(key) {
return queryStringToParamMap()[key];
};
return this;
function toQueryString(paramMap) {
var qStrPairs = [];
for (var prop in paramMap) {
qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop]));
}
return '?' + qStrPairs.join('&');
}
function queryStringToParamMap() {
var paramStr = options.getWindowLocation().search.substring(1),
params = [],
paramMap = {};
if (paramStr.length > 0) {
params = paramStr.split('&');
for (var i = 0; i < params.length; i++) {
var p = params[i].split('=');
var value = decodeURIComponent(p[1]);
if (value === 'true' || value === 'false') {
value = JSON.parse(value);
}
paramMap[decodeURIComponent(p[0])] = value;
}
}
return paramMap;
}
}
return QueryString;
};

View File

@ -18,8 +18,8 @@ body { overflow-y: scroll; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-passed:before { color: #007069; content: "\02022"; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-passed:before { color: #007069; content: "\02022"; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-failed { line-height: 9px; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-failed { line-height: 9px; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-failed:before { color: #ca3a11; content: "\d7"; font-weight: bold; margin-left: -1px; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-failed:before { color: #ca3a11; content: "\d7"; font-weight: bold; margin-left: -1px; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-disabled { font-size: 14px; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-excluded { font-size: 14px; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-disabled:before { color: #bababa; content: "\02022"; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-excluded:before { color: #bababa; content: "\02022"; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending { line-height: 17px; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending { line-height: 17px; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending:before { color: #ba9d37; content: "*"; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-pending:before { color: #ba9d37; content: "*"; }
.jasmine_html-reporter .jasmine-symbol-summary li.jasmine-empty { font-size: 14px; } .jasmine_html-reporter .jasmine-symbol-summary li.jasmine-empty { font-size: 14px; }
@ -29,10 +29,11 @@ body { overflow-y: scroll; }
.jasmine_html-reporter .jasmine-run-options .jasmine-payload { position: absolute; display: none; right: -1px; border: 1px solid #8a4182; background-color: #eee; white-space: nowrap; padding: 4px 8px; } .jasmine_html-reporter .jasmine-run-options .jasmine-payload { position: absolute; display: none; right: -1px; border: 1px solid #8a4182; background-color: #eee; white-space: nowrap; padding: 4px 8px; }
.jasmine_html-reporter .jasmine-run-options .jasmine-payload.jasmine-open { display: block; } .jasmine_html-reporter .jasmine-run-options .jasmine-payload.jasmine-open { display: block; }
.jasmine_html-reporter .jasmine-bar { line-height: 28px; font-size: 14px; display: block; color: #eee; } .jasmine_html-reporter .jasmine-bar { line-height: 28px; font-size: 14px; display: block; color: #eee; }
.jasmine_html-reporter .jasmine-bar.jasmine-failed { background-color: #ca3a11; } .jasmine_html-reporter .jasmine-bar.jasmine-failed, .jasmine_html-reporter .jasmine-bar.jasmine-errored { background-color: #ca3a11; border-bottom: 1px solid #eee; }
.jasmine_html-reporter .jasmine-bar.jasmine-passed { background-color: #007069; } .jasmine_html-reporter .jasmine-bar.jasmine-passed { background-color: #007069; }
.jasmine_html-reporter .jasmine-bar.jasmine-incomplete { background-color: #bababa; }
.jasmine_html-reporter .jasmine-bar.jasmine-skipped { background-color: #bababa; } .jasmine_html-reporter .jasmine-bar.jasmine-skipped { background-color: #bababa; }
.jasmine_html-reporter .jasmine-bar.jasmine-errored { background-color: #ca3a11; } .jasmine_html-reporter .jasmine-bar.jasmine-warning { background-color: #ba9d37; color: #333; }
.jasmine_html-reporter .jasmine-bar.jasmine-menu { background-color: #fff; color: #aaa; } .jasmine_html-reporter .jasmine-bar.jasmine-menu { background-color: #fff; color: #aaa; }
.jasmine_html-reporter .jasmine-bar.jasmine-menu a { color: #333; } .jasmine_html-reporter .jasmine-bar.jasmine-menu a { color: #333; }
.jasmine_html-reporter .jasmine-bar a { color: white; } .jasmine_html-reporter .jasmine-bar a { color: white; }
@ -46,12 +47,12 @@ body { overflow-y: scroll; }
.jasmine_html-reporter .jasmine-summary li.jasmine-failed a { color: #ca3a11; } .jasmine_html-reporter .jasmine-summary li.jasmine-failed a { color: #ca3a11; }
.jasmine_html-reporter .jasmine-summary li.jasmine-empty a { color: #ba9d37; } .jasmine_html-reporter .jasmine-summary li.jasmine-empty a { color: #ba9d37; }
.jasmine_html-reporter .jasmine-summary li.jasmine-pending a { color: #ba9d37; } .jasmine_html-reporter .jasmine-summary li.jasmine-pending a { color: #ba9d37; }
.jasmine_html-reporter .jasmine-summary li.jasmine-disabled a { color: #bababa; } .jasmine_html-reporter .jasmine-summary li.jasmine-excluded a { color: #bababa; }
.jasmine_html-reporter .jasmine-description + .jasmine-suite { margin-top: 0; } .jasmine_html-reporter .jasmine-description + .jasmine-suite { margin-top: 0; }
.jasmine_html-reporter .jasmine-suite { margin-top: 14px; } .jasmine_html-reporter .jasmine-suite { margin-top: 14px; }
.jasmine_html-reporter .jasmine-suite a { color: #333; } .jasmine_html-reporter .jasmine-suite a { color: #333; }
.jasmine_html-reporter .jasmine-failures .jasmine-spec-detail { margin-bottom: 28px; } .jasmine_html-reporter .jasmine-failures .jasmine-spec-detail { margin-bottom: 28px; }
.jasmine_html-reporter .jasmine-failures .jasmine-spec-detail .jasmine-description { background-color: #ca3a11; } .jasmine_html-reporter .jasmine-failures .jasmine-spec-detail .jasmine-description { background-color: #ca3a11; color: white; }
.jasmine_html-reporter .jasmine-failures .jasmine-spec-detail .jasmine-description a { color: white; } .jasmine_html-reporter .jasmine-failures .jasmine-spec-detail .jasmine-description a { color: white; }
.jasmine_html-reporter .jasmine-result-message { padding-top: 14px; color: #333; white-space: pre; } .jasmine_html-reporter .jasmine-result-message { padding-top: 14px; color: #333; white-space: pre; }
.jasmine_html-reporter .jasmine-result-message span.jasmine-result { display: block; } .jasmine_html-reporter .jasmine-result-message span.jasmine-result { display: block; }

6234
vendor/jasmine/jasmine.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB