Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 00a6941

Browse files
committedAug 15, 2016
init
0 parents  commit 00a6941

37 files changed

+3376
-0
lines changed
 

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

‎CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Change Log
2+
All notable changes to this project will be documented in this file.
3+
This project adheres to [Semantic Versioning](http://semver.org/).
4+
5+
## [0.1.0] - 2016-08-14
6+
- created

‎README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# JS CodeRoad
2+
3+
JavaScript features bundled for [CodeRoad](https://coderoad.github.io) test runners.
4+
5+
## Features
6+
- handles `import`'s and `export`'s
7+
- overrides `console.log` to return correct types
8+
- `exists` function for testing folders and files
9+
- `BASE` paths get replaced with user directory file paths
10+
- provides easy testing of globals

‎lib/constants.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
"use strict";
2+
exports.signal = '@@@CodeRoad Results@@@';

‎lib/helpers/babelModules.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.default = "require('babel-core/register')({plugins: [['transform-es2015-modules-commonjs',{loose:true}]]});";

‎lib/helpers/fileExists.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
function fileExistsPolyfill(dir) {
3+
return "function _fileExists(e,r){void 0===r&&(r=!0);try{accessSync(e,F_OK)}catch(c){if(c)return r||console.log(c),!1}return!0}var _require=require(\"fs\"),accessSync=_require.accessSync,F_OK=_require.F_OK,_require2=require(\"path\"),resolve=_require2.resolve;function exists(p){return _fileExists(resolve('" + dir + "',p))}";
4+
}
5+
Object.defineProperty(exports, "__esModule", { value: true });
6+
exports.default = fileExistsPolyfill;

‎lib/helpers/import-paths.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"use strict";
2+
var path_1 = require('path');
3+
var importPathRegex = /require\(["'](BASE.+)["']\)([a-zA-Z0-9\-\_]+)?|^import.+?\s?["'](BASE.+)["'];?$/m;
4+
var relativePathRegex = /^BASE/;
5+
function fixImportPaths(dir, str) {
6+
var entries = new Set([]);
7+
return str.split('\n').map(function (line) {
8+
var isMatch = line.match(importPathRegex);
9+
if (!isMatch) {
10+
return line;
11+
}
12+
var importPath = isMatch[1] || isMatch[2];
13+
if (importPath.match(relativePathRegex)) {
14+
var newPath = path_1.join(dir, importPath.replace('BASE', ''));
15+
var newLine = line.replace(importPath, newPath);
16+
if (!entries.has(newLine)) {
17+
entries.add(newLine);
18+
return newLine;
19+
}
20+
return '';
21+
}
22+
return line;
23+
}).join('\n');
24+
}
25+
Object.defineProperty(exports, "__esModule", { value: true });
26+
exports.default = fixImportPaths;

‎lib/helpers/importPaths.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use strict";
2+
var path_1 = require('path');
3+
var importPathRegex = /require\(["'](BASE.+)["']\)([a-zA-Z0-9\-\_]+)?|^import.+?\s?["'](BASE.+)["'];?$/m;
4+
var relativePathRegex = /^BASE/;
5+
function fixImportPaths(_a) {
6+
var dir = _a.dir, content = _a.content;
7+
var entries = new Set([]);
8+
return content.split('\n').map(function (line) {
9+
var isMatch = line.match(importPathRegex);
10+
if (!isMatch) {
11+
return line;
12+
}
13+
var importPath = isMatch[1] || isMatch[2];
14+
if (importPath.match(relativePathRegex)) {
15+
var newPath = path_1.join(dir, importPath.replace('BASE', ''));
16+
var newLine = line.replace(importPath, newPath);
17+
if (!entries.has(newLine)) {
18+
entries.add(newLine);
19+
return newLine;
20+
}
21+
return '';
22+
}
23+
return line;
24+
}).join('\n');
25+
}
26+
Object.defineProperty(exports, "__esModule", { value: true });
27+
exports.default = fixImportPaths;

‎lib/helpers/overrideRequire.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.default = "require = require('rewire');";

‎lib/index.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"use strict";
2+
var babelModules_1 = require('./helpers/babelModules');
3+
var process_console_log_1 = require('process-console-log');
4+
var fileExists_1 = require('./helpers/fileExists');
5+
var overrideRequire_1 = require('./helpers/overrideRequire');
6+
var importPaths_1 = require('./helpers/importPaths');
7+
var jsCodeRoad = function (_a) {
8+
var dir = _a.dir, content = _a.content;
9+
return ('(function(){\n'
10+
+ process_console_log_1.logger
11+
+ babelModules_1.default
12+
+ fileExists_1.default(dir)
13+
+ overrideRequire_1.default
14+
+ importPaths_1.default({ dir: dir, content: content })
15+
+ '\n}());');
16+
};
17+
Object.defineProperty(exports, "__esModule", { value: true });
18+
exports.default = jsCodeRoad;

‎lib/runner/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
"use strict";
2+
var start_runner_1 = require('./start-runner');
3+
var runner_process_1 = require('./runner-process');
4+
function runner(_a) {
5+
var dir = _a.dir, taskPosition = _a.taskPosition, handleResult = _a.handleResult, testPath = _a.testPath;
6+
var runner = runner_process_1.default({ dir: dir, taskPosition: taskPosition, testPath: testPath });
7+
return start_runner_1.default({ runner: runner, handleResult: handleResult, taskPosition: taskPosition });
8+
}
9+
Object.defineProperty(exports, "__esModule", { value: true });
10+
exports.default = runner;

‎lib/runner/paths/mocha.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"use strict";
2+
var node_file_exists_1 = require('node-file-exists');
3+
var path_1 = require('path');
4+
function getMocha() {
5+
var mocha = path_1.join(__dirname, '..', '..', '..', '..', 'mocha', 'bin', 'mocha');
6+
if (!node_file_exists_1.default(mocha)) {
7+
mocha = path_1.join(__dirname, '..', '..', '..', 'node_modules', 'mocha', 'bin', 'mocha');
8+
if (!node_file_exists_1.default(mocha)) {
9+
var error = 'Error finding mocha';
10+
throw (error);
11+
}
12+
}
13+
return mocha;
14+
}
15+
Object.defineProperty(exports, "__esModule", { value: true });
16+
exports.default = getMocha;

‎lib/runner/paths/node.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"use strict";
2+
var path_1 = require('path');
3+
function getNode() {
4+
if (process.platform === 'darwin' && process.resourcesPath) {
5+
return path_1.resolve(process.resourcesPath, '..', 'Frameworks', 'Atom Helper.app', 'Contents', 'MacOS', 'Atom Helper');
6+
}
7+
else if (process.platform.match(/win/)) {
8+
return 'node';
9+
}
10+
return process.execPath;
11+
}
12+
Object.defineProperty(exports, "__esModule", { value: true });
13+
exports.default = getNode;

‎lib/runner/runner-process.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
"use strict";
2+
var path_1 = require('path');
3+
var child_process_1 = require('child_process');
4+
var mocha_1 = require('./paths/mocha');
5+
var node_1 = require('./paths/node');
6+
var reporterPath = path_1.join(__dirname, '..', 'reporter', 'index.js');
7+
var node = node_1.default();
8+
var mocha = mocha_1.default();
9+
function spawnRunnerProcess(_a) {
10+
var dir = _a.dir, taskPosition = _a.taskPosition, testPath = _a.testPath;
11+
var options = {
12+
cwd: dir
13+
};
14+
if (options.env == null) {
15+
options.env = Object.create(process.env);
16+
}
17+
Object.assign(options.env, {
18+
ATOM_SHELL_INTERNAL_RUN_AS_NODE: 1,
19+
DIR: dir,
20+
TASK_POSITION: taskPosition,
21+
NODE_PATH: path_1.join(dir, 'node_modules'),
22+
});
23+
return child_process_1.spawn(node, [
24+
mocha,
25+
'--bail',
26+
'--harmony',
27+
'--no-colors',
28+
'--timeout=3000',
29+
'--compilers js:babel-core/register',
30+
("--reporter=" + reporterPath),
31+
testPath,
32+
], options);
33+
}
34+
Object.defineProperty(exports, "__esModule", { value: true });
35+
exports.default = spawnRunnerProcess;

‎lib/runner/start-runner.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
"use strict";
2+
var process_console_log_1 = require('process-console-log');
3+
var constants_1 = require('../constants');
4+
var signalMatch = new RegExp(constants_1.signal);
5+
function startRunner(_a) {
6+
var runner = _a.runner, handleResult = _a.handleResult, taskPosition = _a.taskPosition;
7+
var final = null;
8+
new Promise(function run(resolve, reject) {
9+
runner.stdout.on('data', function onData(data) {
10+
data = data.toString();
11+
var match = signalMatch.exec(data);
12+
if (!match) {
13+
try {
14+
process_console_log_1.parseLog(data);
15+
}
16+
catch (e) {
17+
process_console_log_1.parseLog(data);
18+
}
19+
return;
20+
}
21+
var resultString = data.substring(match.index + constants_1.signal.length);
22+
var result = JSON.parse(JSON.stringify(resultString));
23+
if (typeof result === 'string') {
24+
result = JSON.parse(result);
25+
}
26+
switch (result.pass) {
27+
case true:
28+
final = result.passes[result.passes.length - 1];
29+
break;
30+
case false:
31+
final = result.failures[0];
32+
break;
33+
default:
34+
console.log('error processing result: ', result);
35+
}
36+
final.change = final.taskPosition - taskPosition;
37+
final.pass = final.change > 0;
38+
final.completed = result.pass;
39+
handleResult(final);
40+
});
41+
runner.stderr.on('data', function onError(data) {
42+
console.log('test error', data.toString());
43+
});
44+
runner.on('close', function onClose(code) {
45+
resolve(final);
46+
});
47+
});
48+
}
49+
Object.defineProperty(exports, "__esModule", { value: true });
50+
exports.default = startRunner;

‎lib/testPath.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
"use strict";
2+
var path_1 = require('path');
3+
function tmpTestName(testFile) {
4+
return path_1.resolve(__dirname, '..', '.tmp', testFile + '.js');
5+
}
6+
Object.defineProperty(exports, "__esModule", { value: true });
7+
exports.default = tmpTestName;

‎lib/writeTests/helpers.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
"use strict";
2+
function helpers(projectDir) {
3+
return "\n// run time compiler\nrequire('babel-core/register')({plugins: [['transform-es2015-modules-commonjs',{\nloose:true}]]});\n\n// fileExists test helper\nfunction fileExists(e,r){void 0===r&&(r=!0);try{accessSync(e,F_OK)}catch(c){if(c)return r||console.log(c),!1}return!0}var _require=require(\"fs\"),accessSync=_require.accessSync,F_OK=_require.F_OK,_require2=require(\"path\"),resolve=_require2.resolve;function exists(p){return fileExists(resolve('" + projectDir + "',p))}\n\n// overwrite require to catch globals in tests\nrequire = require('rewire');\n\n";
4+
}
5+
Object.defineProperty(exports, "__esModule", { value: true });
6+
exports.default = helpers;

‎lib/writeTests/import-paths.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
"use strict";
2+
var path_1 = require('path');
3+
var importPathRegex = /require\(["'](BASE.+)["']\)([a-zA-Z0-9\-\_]+)?|^import.+?\s?["'](BASE.+)["'];?$/m;
4+
var relativePathRegex = /^BASE/;
5+
function fixImportPaths(dir, str) {
6+
var entries = new Set([]);
7+
return str.split('\n').map(function (line) {
8+
var isMatch = line.match(importPathRegex);
9+
if (!isMatch) {
10+
return line;
11+
}
12+
var importPath = isMatch[1] || isMatch[2];
13+
if (importPath.match(relativePathRegex)) {
14+
var newPath = path_1.join(dir, importPath.replace('BASE', ''));
15+
var newLine = line.replace(importPath, newPath);
16+
if (!entries.has(newLine)) {
17+
entries.add(newLine);
18+
return newLine;
19+
}
20+
return '';
21+
}
22+
return line;
23+
}).join('\n');
24+
}
25+
Object.defineProperty(exports, "__esModule", { value: true });
26+
exports.default = fixImportPaths;

‎lib/writeTests/index.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"use strict";
2+
var fs = require('fs');
3+
var path_1 = require('path');
4+
var process_console_log_1 = require('process-console-log');
5+
var import_paths_1 = require('./import-paths');
6+
var helpers_1 = require('./helpers');
7+
var tmpPath = path_1.join(__dirname, '..', '..', '.tmp');
8+
function writeTest(_a) {
9+
var dir = _a.dir, tests = _a.tests, testPath = _a.testPath;
10+
var output = "(function(){\n"
11+
.concat(process_console_log_1.logger)
12+
.concat(helpers_1.default(dir))
13+
.concat(import_paths_1.default(dir, tests))
14+
.concat('\n}());');
15+
writeTestFile(testPath, output);
16+
}
17+
Object.defineProperty(exports, "__esModule", { value: true });
18+
exports.default = writeTest;
19+
function writeTestFile(testPath, output) {
20+
if (!fs.existsSync(tmpPath)) {
21+
fs.mkdirSync(tmpPath);
22+
}
23+
return new Promise(function (resolve, reject) {
24+
fs.writeFile(testPath, output, function (err) {
25+
if (err) {
26+
reject(err);
27+
}
28+
resolve();
29+
});
30+
});
31+
}

‎package.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"name": "js-coderoad",
3+
"version": "0.1.0",
4+
"description": "bundled javascript features for coderoad test runners",
5+
"keywords": [
6+
"coderoad",
7+
"mocha",
8+
"javascript",
9+
"js"
10+
],
11+
"homepage": "https://github.com/coderoad/js-coderoad#readme",
12+
"bugs": {
13+
"url": "https://github.com/coderoad/js-coderoad/issues"
14+
},
15+
"license": "ISC",
16+
"author": "Shawn McKay <shawn.j.mckay@gmail.com>",
17+
"files": [
18+
"lib",
19+
"package.json",
20+
"*.md"
21+
],
22+
"main": "lib/index.js",
23+
"repository": {
24+
"type": "git",
25+
"url": "git+https://github.com/coderoad/js-coderoad.git"
26+
},
27+
"scripts": {
28+
"test": "echo \"Error: no test specified\" && exit 1"
29+
},
30+
"dependencies": {
31+
"babel-plugin-transform-es2015-modules-commonjs": "6.11.5",
32+
"babel-register": "6.11.6",
33+
"node-file-exists": "1.1.0",
34+
"process-console-log": "0.2.3",
35+
"rewire-coderoad": "3.1.1"
36+
}
37+
}

‎src/helpers/babelModules.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// babel with es2015 import/export
2+
export default `require('babel-core/register')({plugins: [['transform-es2015-modules-commonjs',{loose:true}]]});`;

‎src/helpers/fileExists.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// exists(path/to/file) - relative to project directory
2+
export default function fileExistsPolyfill(dir: string): string {
3+
return `function _fileExists(e,r){void 0===r&&(r=!0);try{accessSync(e,F_OK)}catch(c){if(c)return r||console.log(c),!1}return!0}var _require=require("fs"),accessSync=_require.accessSync,F_OK=_require.F_OK,_require2=require("path"),resolve=_require2.resolve;function exists(p){return _fileExists(resolve('${dir}',p))}`;
4+
}

‎src/helpers/importPaths.ts

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { join } from 'path';
2+
3+
/*
4+
import paths won't match the context of the test runner
5+
fixImportPaths will replace paths with absolute paths
6+
*/
7+
8+
// import or require statement
9+
const importPathRegex =
10+
/require\(["'](BASE.+)["']\)([a-zA-Z0-9\-\_]+)?|^import.+?\s?["'](BASE.+)["'];?$/m;
11+
const relativePathRegex = /^BASE/;
12+
13+
export default function fixImportPaths({dir, content}): string {
14+
// collect import lines
15+
let entries = new Set([]);
16+
17+
return content.split('\n').map(line => {
18+
// line has an import or require ?
19+
const isMatch = line.match(importPathRegex);
20+
if (!isMatch) {
21+
return line;
22+
}
23+
// multiple cases due to import or require regex
24+
const importPath = isMatch[1] || isMatch[2];
25+
// import path: may be relative or absolute
26+
27+
// is a relative path
28+
if (importPath.match(relativePathRegex)) {
29+
let newPath = join(dir, importPath.replace('BASE', ''));
30+
let newLine = line.replace(importPath, newPath);
31+
// add to map of entry files
32+
if (!entries.has(newLine)) {
33+
entries.add(newLine);
34+
return newLine;
35+
}
36+
return '';
37+
}
38+
// no match, return line
39+
return line;
40+
}).join('\n');
41+
}

‎src/helpers/overrideRequire.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default `require = require('rewire');`;

‎src/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import babelModules from './helpers/babelModules';
2+
import { logger } from 'process-console-log';
3+
import fileExists from './helpers/fileExists';
4+
import overrideRequire from './helpers/overrideRequire';
5+
import fixImportPaths from './helpers/importPaths';
6+
7+
const jsCodeRoad = ({dir, content}) => (
8+
'(function(){\n'
9+
+ logger
10+
+ babelModules
11+
+ fileExists(dir)
12+
+ overrideRequire
13+
+ fixImportPaths({dir, content})
14+
+ '\n}());'
15+
);
16+
export default jsCodeRoad;

‎src/typings/chai/chai.d.ts

Lines changed: 388 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,388 @@
1+
// Type definitions for chai 3.2.0
2+
// Project: http://chaijs.com/
3+
// Definitions by: Jed Mao <https://github.com/jedmao/>,
4+
// Bart van der Schoor <https://github.com/Bartvds>,
5+
// Andrew Brown <https://github.com/AGBrown>,
6+
// Olivier Chevet <https://github.com/olivr70>
7+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
8+
9+
// <reference path="../assertion-error/assertion-error.d.ts"/>
10+
11+
declare module Chai {
12+
13+
interface ChaiStatic {
14+
expect: ExpectStatic;
15+
should(): Should;
16+
/**
17+
* Provides a way to extend the internals of Chai
18+
*/
19+
use(fn: (chai: any, utils: any) => void): any;
20+
assert: AssertStatic;
21+
config: Config;
22+
AssertionError: AssertionError;
23+
}
24+
25+
export interface ExpectStatic extends AssertionStatic {
26+
fail(actual?: any, expected?: any, message?: string, operator?: string): void;
27+
}
28+
29+
export interface AssertStatic extends Assert {
30+
}
31+
32+
export interface AssertionStatic {
33+
(target: any, message?: string): Assertion;
34+
}
35+
36+
interface ShouldAssertion {
37+
equal(value1: any, value2: any, message?: string): void;
38+
Throw: ShouldThrow;
39+
throw: ShouldThrow;
40+
exist(value: any, message?: string): void;
41+
}
42+
43+
interface Should extends ShouldAssertion {
44+
not: ShouldAssertion;
45+
fail(actual: any, expected: any, message?: string, operator?: string): void;
46+
}
47+
48+
interface ShouldThrow {
49+
(actual: Function): void;
50+
(actual: Function, expected: string|RegExp, message?: string): void;
51+
(actual: Function, constructor: Error|Function, expected?: string|RegExp, message?: string): void;
52+
}
53+
54+
interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
55+
not: Assertion;
56+
deep: Deep;
57+
any: KeyFilter;
58+
all: KeyFilter;
59+
a: TypeComparison;
60+
an: TypeComparison;
61+
include: Include;
62+
includes: Include;
63+
contain: Include;
64+
contains: Include;
65+
ok: Assertion;
66+
true: Assertion;
67+
false: Assertion;
68+
null: Assertion;
69+
undefined: Assertion;
70+
NaN: Assertion;
71+
exist: Assertion;
72+
empty: Assertion;
73+
arguments: Assertion;
74+
Arguments: Assertion;
75+
equal: Equal;
76+
equals: Equal;
77+
eq: Equal;
78+
eql: Equal;
79+
eqls: Equal;
80+
property: Property;
81+
ownProperty: OwnProperty;
82+
haveOwnProperty: OwnProperty;
83+
ownPropertyDescriptor: OwnPropertyDescriptor;
84+
haveOwnPropertyDescriptor: OwnPropertyDescriptor;
85+
length: Length;
86+
lengthOf: Length;
87+
match: Match;
88+
matches: Match;
89+
string(string: string, message?: string): Assertion;
90+
keys: Keys;
91+
key(string: string): Assertion;
92+
throw: Throw;
93+
throws: Throw;
94+
Throw: Throw;
95+
respondTo: RespondTo;
96+
respondsTo: RespondTo;
97+
itself: Assertion;
98+
satisfy: Satisfy;
99+
satisfies: Satisfy;
100+
closeTo(expected: number, delta: number, message?: string): Assertion;
101+
members: Members;
102+
increase: PropertyChange;
103+
increases: PropertyChange;
104+
decrease: PropertyChange;
105+
decreases: PropertyChange;
106+
change: PropertyChange;
107+
changes: PropertyChange;
108+
extensible: Assertion;
109+
sealed: Assertion;
110+
frozen: Assertion;
111+
112+
}
113+
114+
interface LanguageChains {
115+
to: Assertion;
116+
be: Assertion;
117+
been: Assertion;
118+
is: Assertion;
119+
that: Assertion;
120+
which: Assertion;
121+
and: Assertion;
122+
has: Assertion;
123+
have: Assertion;
124+
with: Assertion;
125+
at: Assertion;
126+
of: Assertion;
127+
same: Assertion;
128+
}
129+
130+
interface NumericComparison {
131+
above: NumberComparer;
132+
gt: NumberComparer;
133+
greaterThan: NumberComparer;
134+
least: NumberComparer;
135+
gte: NumberComparer;
136+
below: NumberComparer;
137+
lt: NumberComparer;
138+
lessThan: NumberComparer;
139+
most: NumberComparer;
140+
lte: NumberComparer;
141+
within(start: number, finish: number, message?: string): Assertion;
142+
}
143+
144+
interface NumberComparer {
145+
(value: number, message?: string): Assertion;
146+
}
147+
148+
interface TypeComparison {
149+
(type: string, message?: string): Assertion;
150+
instanceof: InstanceOf;
151+
instanceOf: InstanceOf;
152+
}
153+
154+
interface InstanceOf {
155+
(constructor: Object, message?: string): Assertion;
156+
}
157+
158+
interface Deep {
159+
equal: Equal;
160+
include: Include;
161+
property: Property;
162+
members: Members;
163+
}
164+
165+
interface KeyFilter {
166+
keys: Keys;
167+
}
168+
169+
interface Equal {
170+
(value: any, message?: string): Assertion;
171+
}
172+
173+
interface Property {
174+
(name: string, value?: any, message?: string): Assertion;
175+
}
176+
177+
interface OwnProperty {
178+
(name: string, message?: string): Assertion;
179+
}
180+
181+
interface OwnPropertyDescriptor {
182+
(name: string, descriptor: PropertyDescriptor, message?: string): Assertion;
183+
(name: string, message?: string): Assertion;
184+
}
185+
186+
interface Length extends LanguageChains, NumericComparison {
187+
(length: number, message?: string): Assertion;
188+
}
189+
190+
interface Include {
191+
(value: Object, message?: string): Assertion;
192+
(value: string, message?: string): Assertion;
193+
(value: number, message?: string): Assertion;
194+
keys: Keys;
195+
members: Members;
196+
any: KeyFilter;
197+
all: KeyFilter;
198+
}
199+
200+
interface Match {
201+
(regexp: RegExp|string, message?: string): Assertion;
202+
}
203+
204+
interface Keys {
205+
(...keys: string[]): Assertion;
206+
(keys: any[]): Assertion;
207+
(keys: Object): Assertion;
208+
}
209+
210+
interface Throw {
211+
(): Assertion;
212+
(expected: string, message?: string): Assertion;
213+
(expected: RegExp, message?: string): Assertion;
214+
(constructor: Error, expected?: string, message?: string): Assertion;
215+
(constructor: Error, expected?: RegExp, message?: string): Assertion;
216+
(constructor: Function, expected?: string, message?: string): Assertion;
217+
(constructor: Function, expected?: RegExp, message?: string): Assertion;
218+
}
219+
220+
interface RespondTo {
221+
(method: string, message?: string): Assertion;
222+
}
223+
224+
interface Satisfy {
225+
(matcher: Function, message?: string): Assertion;
226+
}
227+
228+
interface Members {
229+
(set: any[], message?: string): Assertion;
230+
}
231+
232+
interface PropertyChange {
233+
(object: Object, prop: string, msg?: string): Assertion;
234+
}
235+
236+
export interface Assert {
237+
/**
238+
* @param expression Expression to test for truthiness.
239+
* @param message Message to display on error.
240+
*/
241+
(expression: any, message?: string): void;
242+
243+
fail(actual?: any, expected?: any, msg?: string, operator?: string): void;
244+
245+
ok(val: any, msg?: string): void;
246+
isOk(val: any, msg?: string): void;
247+
notOk(val: any, msg?: string): void;
248+
isNotOk(val: any, msg?: string): void;
249+
250+
equal(act: any, exp: any, msg?: string): void;
251+
notEqual(act: any, exp: any, msg?: string): void;
252+
253+
strictEqual(act: any, exp: any, msg?: string): void;
254+
notStrictEqual(act: any, exp: any, msg?: string): void;
255+
256+
deepEqual(act: any, exp: any, msg?: string): void;
257+
notDeepEqual(act: any, exp: any, msg?: string): void;
258+
259+
isTrue(val: any, msg?: string): void;
260+
isFalse(val: any, msg?: string): void;
261+
262+
isNull(val: any, msg?: string): void;
263+
isNotNull(val: any, msg?: string): void;
264+
265+
isUndefined(val: any, msg?: string): void;
266+
isDefined(val: any, msg?: string): void;
267+
268+
isNaN(val: any, msg?: string): void;
269+
isNotNaN(val: any, msg?: string): void;
270+
271+
isAbove(val: number, abv: number, msg?: string): void;
272+
isBelow(val: number, blw: number, msg?: string): void;
273+
274+
isFunction(val: any, msg?: string): void;
275+
isNotFunction(val: any, msg?: string): void;
276+
277+
isObject(val: any, msg?: string): void;
278+
isNotObject(val: any, msg?: string): void;
279+
280+
isArray(val: any, msg?: string): void;
281+
isNotArray(val: any, msg?: string): void;
282+
283+
isString(val: any, msg?: string): void;
284+
isNotString(val: any, msg?: string): void;
285+
286+
isNumber(val: any, msg?: string): void;
287+
isNotNumber(val: any, msg?: string): void;
288+
289+
isBoolean(val: any, msg?: string): void;
290+
isNotBoolean(val: any, msg?: string): void;
291+
292+
typeOf(val: any, type: string, msg?: string): void;
293+
notTypeOf(val: any, type: string, msg?: string): void;
294+
295+
instanceOf(val: any, type: Function, msg?: string): void;
296+
notInstanceOf(val: any, type: Function, msg?: string): void;
297+
298+
include(exp: string, inc: any, msg?: string): void;
299+
include(exp: any[], inc: any, msg?: string): void;
300+
301+
notInclude(exp: string, inc: any, msg?: string): void;
302+
notInclude(exp: any[], inc: any, msg?: string): void;
303+
304+
match(exp: any, re: RegExp, msg?: string): void;
305+
notMatch(exp: any, re: RegExp, msg?: string): void;
306+
307+
property(obj: Object, prop: string, msg?: string): void;
308+
notProperty(obj: Object, prop: string, msg?: string): void;
309+
deepProperty(obj: Object, prop: string, msg?: string): void;
310+
notDeepProperty(obj: Object, prop: string, msg?: string): void;
311+
312+
propertyVal(obj: Object, prop: string, val: any, msg?: string): void;
313+
propertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
314+
315+
deepPropertyVal(obj: Object, prop: string, val: any, msg?: string): void;
316+
deepPropertyNotVal(obj: Object, prop: string, val: any, msg?: string): void;
317+
318+
lengthOf(exp: any, len: number, msg?: string): void;
319+
//alias frenzy
320+
throw(fn: Function, msg?: string): void;
321+
throw(fn: Function, regExp: RegExp): void;
322+
throw(fn: Function, errType: Function, msg?: string): void;
323+
throw(fn: Function, errType: Function, regExp: RegExp): void;
324+
325+
throws(fn: Function, msg?: string): void;
326+
throws(fn: Function, regExp: RegExp): void;
327+
throws(fn: Function, errType: Function, msg?: string): void;
328+
throws(fn: Function, errType: Function, regExp: RegExp): void;
329+
330+
Throw(fn: Function, msg?: string): void;
331+
Throw(fn: Function, regExp: RegExp): void;
332+
Throw(fn: Function, errType: Function, msg?: string): void;
333+
Throw(fn: Function, errType: Function, regExp: RegExp): void;
334+
335+
doesNotThrow(fn: Function, msg?: string): void;
336+
doesNotThrow(fn: Function, regExp: RegExp): void;
337+
doesNotThrow(fn: Function, errType: Function, msg?: string): void;
338+
doesNotThrow(fn: Function, errType: Function, regExp: RegExp): void;
339+
340+
operator(val: any, operator: string, val2: any, msg?: string): void;
341+
closeTo(act: number, exp: number, delta: number, msg?: string): void;
342+
343+
sameMembers(set1: any[], set2: any[], msg?: string): void;
344+
sameDeepMembers(set1: any[], set2: any[], msg?: string): void;
345+
includeMembers(superset: any[], subset: any[], msg?: string): void;
346+
347+
ifError(val: any, msg?: string): void;
348+
349+
isExtensible(obj: {}, msg?: string): void;
350+
extensible(obj: {}, msg?: string): void;
351+
isNotExtensible(obj: {}, msg?: string): void;
352+
notExtensible(obj: {}, msg?: string): void;
353+
354+
isSealed(obj: {}, msg?: string): void;
355+
sealed(obj: {}, msg?: string): void;
356+
isNotSealed(obj: {}, msg?: string): void;
357+
notSealed(obj: {}, msg?: string): void;
358+
359+
isFrozen(obj: Object, msg?: string): void;
360+
frozen(obj: Object, msg?: string): void;
361+
isNotFrozen(obj: Object, msg?: string): void;
362+
notFrozen(obj: Object, msg?: string): void;
363+
364+
365+
}
366+
367+
export interface Config {
368+
includeStack: boolean;
369+
}
370+
371+
export class AssertionError {
372+
constructor(message: string, _props?: any, ssf?: Function);
373+
name: string;
374+
message: string;
375+
showDiff: boolean;
376+
stack: string;
377+
}
378+
}
379+
380+
declare var chai: Chai.ChaiStatic;
381+
382+
declare module "chai" {
383+
export = chai;
384+
}
385+
386+
interface Object {
387+
should: Chai.Assertion;
388+
}

‎src/typings/cr/cr.d.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
declare module CR {
2+
3+
interface TestResult {
4+
pass: boolean;
5+
taskPosition: number;
6+
msg?: string;
7+
timedOut?: boolean;
8+
change: number;
9+
completed: boolean;
10+
}
11+
12+
interface Config {
13+
dir: string;
14+
package?: string;
15+
runner?: string;
16+
tutorial?: string;
17+
tutorialDir?: string;
18+
runnerOptions?: Object;
19+
issuesPath?: string;
20+
repo?: string;
21+
edit?: boolean;
22+
run?: any;
23+
taskPosition?: number;
24+
}
25+
26+
}
27+
28+
interface Process {
29+
resourcesPath: string;
30+
}

‎src/typings/cr/globals.d.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
interface Global {
2+
loadEditor: (pathToContext: string, options?: Object) => void;
3+
loadGlobal: (name: string, pathToContext: string) => void;
4+
}
5+
6+
interface ObjectConstructor {
7+
assign(target: any, ...sources: any[]): any;
8+
}
9+
10+
declare var global: Global;
11+
12+
declare module 'babel-core' {
13+
var babel: any;
14+
export default babel;
15+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Type definitions for es6-promise
2+
// Project: https://github.com/jakearchibald/ES6-Promise
3+
// Definitions by: François de Campredon <https://github.com/fdecampredon/>, vvakame <https://github.com/vvakame>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
interface Thenable<R> {
7+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
8+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
9+
}
10+
11+
declare class Promise<R> implements Thenable<R> {
12+
/**
13+
* If you call resolve in the body of the callback passed to the constructor,
14+
* your promise is fulfilled with result object passed to resolve.
15+
* If you call reject your promise is rejected with the object passed to resolve.
16+
* For consistency and debugging (eg stack traces), obj should be an instanceof Error.
17+
* Any errors thrown in the constructor callback will be implicitly passed to reject().
18+
*/
19+
constructor(callback: (resolve : (value?: R | Thenable<R>) => void, reject: (error?: any) => void) => void);
20+
21+
/**
22+
* onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
23+
* Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called.
24+
* Both callbacks have a single parameter , the fulfillment value or rejection reason.
25+
* "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve.
26+
* If an error is thrown in the callback, the returned promise rejects with that error.
27+
*
28+
* @param onFulfilled called when/if "promise" resolves
29+
* @param onRejected called when/if "promise" rejects
30+
*/
31+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
32+
then<U>(onFulfilled?: (value: R) => U | Thenable<U>, onRejected?: (error: any) => void): Promise<U>;
33+
34+
/**
35+
* Sugar for promise.then(undefined, onRejected)
36+
*
37+
* @param onRejected called when/if "promise" rejects
38+
*/
39+
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
40+
}
41+
42+
declare module Promise {
43+
/**
44+
* Make a new promise from the thenable.
45+
* A thenable is promise-like in as far as it has a "then" method.
46+
*/
47+
function resolve<R>(value?: R | Thenable<R>): Promise<R>;
48+
49+
/**
50+
* Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error
51+
*/
52+
function reject(error: any): Promise<any>;
53+
54+
/**
55+
* Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects.
56+
* the array passed to all can be a mixture of promise-like objects and other objects.
57+
* The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.
58+
*/
59+
function all<R>(promises: (R | Thenable<R>)[]): Promise<R[]>;
60+
61+
/**
62+
* Make a Promise that fulfills when any item fulfills, and rejects if any item rejects.
63+
*/
64+
function race<R>(promises: (R | Thenable<R>)[]): Promise<R>;
65+
}
66+
67+
declare module 'es6-promise' {
68+
var foo: typeof Promise; // Temp variable to reference Promise in local context
69+
module rsvp {
70+
export var Promise: typeof foo;
71+
}
72+
export = rsvp;
73+
}

‎src/typings/mocha/mocha.d.ts

Lines changed: 236 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
// Type definitions for mocha 2.2.5
2+
// Project: http://mochajs.org/
3+
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>, otiai10 <https://github.com/otiai10>, jt000 <https://github.com/jt000>, Vadim Macagon <https://github.com/enlight>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
interface MochaSetupOptions {
7+
// milliseconds to wait before considering a test slow
8+
slow?: number;
9+
10+
// timeout in milliseconds
11+
timeout?: number;
12+
13+
// ui name "bdd", "tdd", "exports" etc
14+
ui?: string;
15+
16+
// array of accepted globals
17+
globals?: any[];
18+
19+
// reporter instance (function or string), defaults to `mocha.reporters.Spec`
20+
reporter?: any;
21+
22+
// bail on the first test failure
23+
bail?: boolean;
24+
25+
// ignore global leaks
26+
ignoreLeaks?: boolean;
27+
28+
// grep string or regexp to filter tests with
29+
grep?: any;
30+
}
31+
32+
interface MochaDone {
33+
(error?: Error): void;
34+
}
35+
36+
declare var mocha: Mocha;
37+
declare var describe: Mocha.IContextDefinition;
38+
declare var xdescribe: Mocha.IContextDefinition;
39+
// alias for `describe`
40+
declare var context: Mocha.IContextDefinition;
41+
// alias for `describe`
42+
declare var suite: Mocha.IContextDefinition;
43+
declare var it: Mocha.ITestDefinition;
44+
declare var xit: Mocha.ITestDefinition;
45+
// alias for `it`
46+
declare var test: Mocha.ITestDefinition;
47+
48+
declare function before(action: () => void): void;
49+
50+
declare function before(action: (done: MochaDone) => void): void;
51+
52+
declare function before(description: string, action: () => void): void;
53+
54+
declare function before(description: string, action: (done: MochaDone) => void): void;
55+
56+
declare function setup(action: () => void): void;
57+
58+
declare function setup(action: (done: MochaDone) => void): void;
59+
60+
declare function after(action: () => void): void;
61+
62+
declare function after(action: (done: MochaDone) => void): void;
63+
64+
declare function after(description: string, action: () => void): void;
65+
66+
declare function after(description: string, action: (done: MochaDone) => void): void;
67+
68+
declare function teardown(action: () => void): void;
69+
70+
declare function teardown(action: (done: MochaDone) => void): void;
71+
72+
declare function beforeEach(action: () => void): void;
73+
74+
declare function beforeEach(action: (done: MochaDone) => void): void;
75+
76+
declare function beforeEach(description: string, action: () => void): void;
77+
78+
declare function beforeEach(description: string, action: (done: MochaDone) => void): void;
79+
80+
declare function suiteSetup(action: () => void): void;
81+
82+
declare function suiteSetup(action: (done: MochaDone) => void): void;
83+
84+
declare function afterEach(action: () => void): void;
85+
86+
declare function afterEach(action: (done: MochaDone) => void): void;
87+
88+
declare function afterEach(description: string, action: () => void): void;
89+
90+
declare function afterEach(description: string, action: (done: MochaDone) => void): void;
91+
92+
declare function suiteTeardown(action: () => void): void;
93+
94+
declare function suiteTeardown(action: (done: MochaDone) => void): void;
95+
96+
declare class Mocha {
97+
constructor(options?: {
98+
grep?: RegExp;
99+
ui?: string;
100+
reporter?: string;
101+
timeout?: number;
102+
bail?: boolean;
103+
});
104+
105+
/** Setup mocha with the given options. */
106+
setup(options: MochaSetupOptions): Mocha;
107+
bail(value?: boolean): Mocha;
108+
addFile(file: string): Mocha;
109+
/** Sets reporter by name, defaults to "spec". */
110+
reporter(name: string): Mocha;
111+
/** Sets reporter constructor, defaults to mocha.reporters.Spec. */
112+
reporter(reporter: (runner: Mocha.IRunner, options: any) => any): Mocha;
113+
ui(value: string): Mocha;
114+
grep(value: string): Mocha;
115+
grep(value: RegExp): Mocha;
116+
invert(): Mocha;
117+
ignoreLeaks(value: boolean): Mocha;
118+
checkLeaks(): Mocha;
119+
/**
120+
* Function to allow assertion libraries to throw errors directly into mocha.
121+
* This is useful when running tests in a browser because window.onerror will
122+
* only receive the 'message' attribute of the Error.
123+
*/
124+
throwError(error: Error): void;
125+
/** Enables growl support. */
126+
growl(): Mocha;
127+
globals(value: string): Mocha;
128+
globals(values: string[]): Mocha;
129+
useColors(value: boolean): Mocha;
130+
useInlineDiffs(value: boolean): Mocha;
131+
timeout(value: number): Mocha;
132+
slow(value: number): Mocha;
133+
enableTimeouts(value: boolean): Mocha;
134+
asyncOnly(value: boolean): Mocha;
135+
noHighlighting(value: boolean): Mocha;
136+
/** Runs tests and invokes `onComplete()` when finished. */
137+
run(onComplete?: (failures: number) => void): Mocha.IRunner;
138+
}
139+
140+
// merge the Mocha class declaration with a module
141+
declare module Mocha {
142+
/** Partial interface for Mocha's `Runnable` class. */
143+
interface IRunnable {
144+
title: string;
145+
fn: Function;
146+
async: boolean;
147+
sync: boolean;
148+
timedOut: boolean;
149+
}
150+
151+
/** Partial interface for Mocha's `Suite` class. */
152+
interface ISuite {
153+
parent: ISuite;
154+
title: string;
155+
156+
fullTitle(): string;
157+
}
158+
159+
/** Partial interface for Mocha's `Test` class. */
160+
interface ITest extends IRunnable {
161+
parent: ISuite;
162+
pending: boolean;
163+
164+
fullTitle(): string;
165+
}
166+
167+
/** Partial interface for Mocha's `Runner` class. */
168+
interface IRunner {}
169+
170+
interface IContextDefinition {
171+
(description: string, spec: () => void): ISuite;
172+
only(description: string, spec: () => void): ISuite;
173+
skip(description: string, spec: () => void): void;
174+
timeout(ms: number): void;
175+
}
176+
177+
interface ITestDefinition {
178+
(expectation: string, assertion?: () => void): ITest;
179+
(expectation: string, assertion?: (done: MochaDone) => void): ITest;
180+
only(expectation: string, assertion?: () => void): ITest;
181+
only(expectation: string, assertion?: (done: MochaDone) => void): ITest;
182+
skip(expectation: string, assertion?: () => void): void;
183+
skip(expectation: string, assertion?: (done: MochaDone) => void): void;
184+
timeout(ms: number): void;
185+
}
186+
187+
export module reporters {
188+
export class Base {
189+
stats: {
190+
suites: number;
191+
tests: number;
192+
passes: number;
193+
pending: number;
194+
failures: number;
195+
};
196+
197+
constructor(runner: IRunner);
198+
}
199+
200+
export class Doc extends Base {}
201+
export class Dot extends Base {}
202+
export class HTML extends Base {}
203+
export class HTMLCov extends Base {}
204+
export class JSON extends Base {}
205+
export class JSONCov extends Base {}
206+
export class JSONStream extends Base {}
207+
export class Landing extends Base {}
208+
export class List extends Base {}
209+
export class Markdown extends Base {}
210+
export class Min extends Base {}
211+
export class Nyan extends Base {}
212+
export class Progress extends Base {
213+
/**
214+
* @param options.open String used to indicate the start of the progress bar.
215+
* @param options.complete String used to indicate a complete test on the progress bar.
216+
* @param options.incomplete String used to indicate an incomplete test on the progress bar.
217+
* @param options.close String used to indicate the end of the progress bar.
218+
*/
219+
constructor(runner: IRunner, options?: {
220+
open?: string;
221+
complete?: string;
222+
incomplete?: string;
223+
close?: string;
224+
});
225+
}
226+
export class Spec extends Base {}
227+
export class TAP extends Base {}
228+
export class XUnit extends Base {
229+
constructor(runner: IRunner, options?: any);
230+
}
231+
}
232+
}
233+
234+
declare module 'mocha' {
235+
export = Mocha;
236+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module 'node-file-exists' {
2+
export default function fileExists(path: string): boolean;
3+
}

‎src/typings/node/node.d.ts

Lines changed: 2089 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
declare module 'process-console-log' {
2+
export function parseLog(logged: {type: string, output: any}[]): void;
3+
export function initProcessLogger(): void;
4+
export const logger: string;
5+
}

‎src/typings/set/set.d.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
interface Set<T> {
2+
add(value: T): Set<T>;
3+
clear(): void;
4+
delete(value: T): boolean;
5+
entries(): IterableIterator<[T, T]>;
6+
forEach(callbackfn: (value: T, index: T, set: Set<T>) => void, thisArg?: any): void;
7+
has(value: T): boolean;
8+
keys(): IterableIterator<T>;
9+
size: number;
10+
values(): IterableIterator<T>;
11+
[Symbol.iterator]():IterableIterator<T>;
12+
[Symbol.toStringTag]: string;
13+
}
14+
15+
interface SetConstructor {
16+
new <T>(): Set<T>;
17+
new <T>(iterable: Iterable<T>): Set<T>;
18+
prototype: Set<any>;
19+
}
20+
declare var Set: SetConstructor;

‎src/typings/tsd.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/// <reference path="chai/chai.d.ts" />
2+
/// <reference path="es6-promise/es6-promise.d.ts" />
3+
/// <reference path="mocha/mocha.d.ts" />
4+
/// <reference path="node/node.d.ts" />
5+
/// <reference path="set/set.d.ts" />
6+
/// <reference path="cr/globals.d.ts" />
7+
/// <reference path="cr/cr.d.ts" />
8+
9+
interface CombineTestsOptions {
10+
dir: string;
11+
tutorial: {
12+
name: string;
13+
version: string;
14+
};
15+
tests: string;
16+
testPath: string;
17+
testFile?: string;
18+
}

‎tsconfig.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"compilerOptions": {
3+
"target": "ES5",
4+
"module": "commonjs",
5+
"declaration": false,
6+
"noImplicitAny": false,
7+
"removeComments": true,
8+
"noEmit": false,
9+
"outDir": "lib"
10+
},
11+
"compileOnSave": true,
12+
"buildOnSave": true,
13+
"filesGlob": [
14+
"src/*.ts",
15+
"src/**/*.ts",
16+
"src/typings/**/*.d.ts"
17+
],
18+
"files": [
19+
"src/index.ts",
20+
"src/helpers/babelModules.ts",
21+
"src/helpers/fileExists.ts",
22+
"src/helpers/importPaths.ts",
23+
"src/helpers/overrideRequire.ts",
24+
"src/typings/chai/chai.d.ts",
25+
"src/typings/cr/cr.d.ts",
26+
"src/typings/cr/globals.d.ts",
27+
"src/typings/es6-promise/es6-promise.d.ts",
28+
"src/typings/mocha/mocha.d.ts",
29+
"src/typings/node-file-exists/node-file-exists.d.ts",
30+
"src/typings/node/node.d.ts",
31+
"src/typings/process-console-log/index.d.ts",
32+
"src/typings/set/set.d.ts",
33+
"src/typings/tsd.d.ts"
34+
],
35+
"exclude": [
36+
"node_modules"
37+
],
38+
"atom": {
39+
"rewriteTsconfig": true
40+
}
41+
}

‎tslint.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"rules": {
3+
"class-name": true,
4+
"comment-format": [true, "check-space"],
5+
"curly": true,
6+
"eofline": true,
7+
"forin": true,
8+
"indent": [true, "spaces"],
9+
"label-position": true,
10+
"label-undefined": true,
11+
"max-line-length": [true, 140],
12+
"member-ordering": [true,
13+
"public-before-private",
14+
"static-before-instance",
15+
"variables-before-functions"
16+
],
17+
"no-arg": true,
18+
"no-bitwise": true,
19+
"no-console": [true,
20+
"debug",
21+
"info",
22+
"time",
23+
"timeEnd",
24+
"trace"
25+
],
26+
"no-construct": true,
27+
"no-debugger": true,
28+
"no-duplicate-key": false,
29+
"no-duplicate-variable": true,
30+
"no-empty": true,
31+
"no-eval": true,
32+
"no-shadowed-variable": true,
33+
"no-string-literal": true,
34+
"no-switch-case-fall-through": true,
35+
"no-trailing-whitespace": true,
36+
"no-unused-expression": true,
37+
"no-unused-variable": true,
38+
"no-unreachable": true,
39+
"no-use-before-declare": true,
40+
"no-var-keyword": false,
41+
"one-line": [true,
42+
"check-open-brace",
43+
"check-catch",
44+
"check-else",
45+
"check-finally",
46+
"check-whitespace"
47+
],
48+
"quotemark": [true, "single"],
49+
"radix": true,
50+
"semicolon": true,
51+
"triple-equals": [true, "allow-null-check"],
52+
"variable-name": false,
53+
"whitespace": [true,
54+
"check-branch",
55+
"check-decl",
56+
"check-operator",
57+
"check-separator",
58+
"check-type"
59+
]
60+
}
61+
}

0 commit comments

Comments
 (0)
Please sign in to comment.