Skip to content

Commit

Permalink
Merge all orphaned tags: 'v1.1.2', 'v2.0.2', 'v2.1.1', 'v2.2.2', 'v2.…
Browse files Browse the repository at this point in the history
…3.3', 'v2.4.3', 'v2.5.1', 'v2.6.1', 'v2.7.3', 'v2.8.1', 'v2.9.1', 'v2.10.3', 'v2.11.1', 'v2.13.4', 'v2.14.0', 'v2.14.1', 'v3.6.1'
  • Loading branch information
ljharb committed Feb 9, 2019
Show file tree
Hide file tree
Showing 84 changed files with 3,512 additions and 902 deletions.
33 changes: 33 additions & 0 deletions .editorconfig
@@ -0,0 +1,33 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 140
block_comment_start = /*
block_comment = *
block_comment_end = */

[*.md]
indent_style = space
indent_size = 4

[readme.markdown]
indent_size = off
max_line_length = off

[*.json]
max_line_length = off

[*.yml]
max_line_length = off

[Makefile]
max_line_length = off

[.travis.yml]
indent_size = 2
6 changes: 6 additions & 0 deletions .eslintrc
@@ -0,0 +1,6 @@
{
"root": true,
"rules": {
"indent": ["error", 4],
},
}
8 changes: 7 additions & 1 deletion .gitignore
@@ -1 +1,7 @@
node_modules
# gitignore

/node_modules

# Only apps should have lockfiles
yarn.lock
package-lock.json
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
package-lock=false
36 changes: 35 additions & 1 deletion .travis.yml
@@ -1,4 +1,38 @@
language: node_js
os:
- linux
node_js:
- "0.8"
- "10"
- "9"
- "8"
- "7"
- "6"
- "5"
- "4"
- "iojs"
- "0.12"
- "0.10"
- "0.8"
before_install:
- 'case "${TRAVIS_NODE_VERSION}" in 0.*) export NPM_CONFIG_STRICT_SSL=false ;; esac'
- 'nvm install-latest-npm'
install:
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.9" ]; then nvm install --latest-npm 0.8 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
script:
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
sudo: false
env:
- TEST=true
matrix:
fast_finish: true
include:
- node_js: "lts/*"
env: PRETEST=true
allow_failures:
- node_js: "9"
- node_js: "7"
- node_js: "5"
- node_js: "iojs"
41 changes: 38 additions & 3 deletions bin/tape
@@ -1,8 +1,43 @@
#!/usr/bin/env node

var path = require('path');
process.argv.slice(2).forEach(function(file) {
require(path.resolve(process.cwd(), file));
var resolveModule = require('resolve').sync;
var resolvePath = require('path').resolve;
var parseOpts = require('minimist');
var glob = require('glob');

var opts = parseOpts(process.argv.slice(2), {
alias: { r: 'require' },
string: 'require',
default: { r: [] }
});

var cwd = process.cwd();

if (typeof opts.require === 'string') {
opts.require = [opts.require];
}

opts.require.forEach(function(module) {
if (module) {
/* This check ensures we ignore `-r ""`, trailing `-r`, or
* other silly things the user might (inadvertently) be doing.
*/
require(resolveModule(module, { basedir: cwd }));
}
});

opts._.forEach(function (arg) {
// If glob does not match, `files` will be an empty array.
// Note: `glob.sync` may throw an error and crash the node process.
var files = glob.sync(arg);

if (!Array.isArray(files)) {
throw new TypeError('unknown error: glob.sync did not return an array or throw. Please report this.');
}

files.forEach(function (file) {
require(resolvePath(cwd, file));
});
});

// vim: ft=javascript
8 changes: 4 additions & 4 deletions example/array.js
Expand Up @@ -3,26 +3,26 @@ var test = require('../');

test('array', function (t) {
t.plan(5);

var src = '(' + function () {
var xs = [ 1, 2, [ 3, 4 ] ];
var ys = [ 5, 6 ];
g([ xs, ys ]);
} + ')()';

var output = falafel(src, function (node) {
if (node.type === 'ArrayExpression') {
node.update('fn(' + node.source() + ')');
}
});

var arrays = [
[ 3, 4 ],
[ 1, 2, [ 3, 4 ] ],
[ 5, 6 ],
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ],
];

Function(['fn','g'], output)(
function (xs) {
t.same(arrays.shift(), xs);
Expand Down
8 changes: 4 additions & 4 deletions example/fail.js
Expand Up @@ -3,26 +3,26 @@ var test = require('../');

test('array', function (t) {
t.plan(5);

var src = '(' + function () {
var xs = [ 1, 2, [ 3, 4 ] ];
var ys = [ 5, 6 ];
g([ xs, ys ]);
} + ')()';

var output = falafel(src, function (node) {
if (node.type === 'ArrayExpression') {
node.update('fn(' + node.source() + ')');
}
});

var arrays = [
[ 3, 4 ],
[ 1, 2, [ 3, 4 ] ],
[ 5, 6 ],
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ],
];

Function(['fn','g'], output)(
function (xs) {
t.same(arrays.shift(), xs);
Expand Down
12 changes: 6 additions & 6 deletions example/nested.js
Expand Up @@ -3,35 +3,35 @@ var test = require('../');

test('nested array test', function (t) {
t.plan(5);

var src = '(' + function () {
var xs = [ 1, 2, [ 3, 4 ] ];
var ys = [ 5, 6 ];
g([ xs, ys ]);
} + ')()';

var output = falafel(src, function (node) {
if (node.type === 'ArrayExpression') {
node.update('fn(' + node.source() + ')');
}
});

t.test('inside test', function (q) {
q.plan(2);
q.ok(true, 'inside ok');

setTimeout(function () {
q.ok(true, 'inside delayed');
}, 3000);
});

var arrays = [
[ 3, 4 ],
[ 1, 2, [ 3, 4 ] ],
[ 5, 6 ],
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ],
];

Function(['fn','g'], output)(
function (xs) {
t.same(arrays.shift(), xs);
Expand Down
12 changes: 6 additions & 6 deletions example/nested_fail.js
Expand Up @@ -3,35 +3,35 @@ var test = require('../');

test('nested array test', function (t) {
t.plan(5);

var src = '(' + function () {
var xs = [ 1, 2, [ 3, 4 ] ];
var ys = [ 5, 6 ];
g([ xs, ys ]);
} + ')()';

var output = falafel(src, function (node) {
if (node.type === 'ArrayExpression') {
node.update('fn(' + node.source() + ')');
}
});

t.test('inside test', function (q) {
q.plan(2);
q.ok(true);

setTimeout(function () {
q.equal(3, 4);
}, 3000);
});

var arrays = [
[ 3, 4 ],
[ 1, 2, [ 3, 4 ] ],
[ 5, 6 ],
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ],
];

Function(['fn','g'], output)(
function (xs) {
t.same(arrays.shift(), xs);
Expand Down
8 changes: 4 additions & 4 deletions example/not_enough.js
Expand Up @@ -3,26 +3,26 @@ var test = require('../');

test('array', function (t) {
t.plan(8);

var src = '(' + function () {
var xs = [ 1, 2, [ 3, 4 ] ];
var ys = [ 5, 6 ];
g([ xs, ys ]);
} + ')()';

var output = falafel(src, function (node) {
if (node.type === 'ArrayExpression') {
node.update('fn(' + node.source() + ')');
}
});

var arrays = [
[ 3, 4 ],
[ 1, 2, [ 3, 4 ] ],
[ 5, 6 ],
[ [ 1, 2, [ 3, 4 ] ], [ 5, 6 ] ],
];

Function(['fn','g'], output)(
function (xs) {
t.same(arrays.shift(), xs);
Expand Down
10 changes: 10 additions & 0 deletions example/stream/object.js
@@ -0,0 +1,10 @@
var test = require('../../');
var path = require('path');

test.createStream({ objectMode: true }).on('data', function (row) {
console.log(JSON.stringify(row))
});

process.argv.slice(2).forEach(function (file) {
require(path.resolve(file));
});
8 changes: 8 additions & 0 deletions example/stream/tap.js
@@ -0,0 +1,8 @@
var test = require('../../');
var path = require('path');

test.createStream().pipe(process.stdout);

process.argv.slice(2).forEach(function (file) {
require(path.resolve(file));
});
5 changes: 5 additions & 0 deletions example/stream/test/x.js
@@ -0,0 +1,5 @@
var test = require('../../../');
test(function (t) {
t.plan(1);
t.equal('beep', 'boop');
});
11 changes: 11 additions & 0 deletions example/stream/test/y.js
@@ -0,0 +1,11 @@
var test = require('../../../');
test(function (t) {
t.plan(2);
t.equal(1+1, 2);
t.ok(true);
});

test('wheee', function (t) {
t.ok(true);
t.end();
});
2 changes: 1 addition & 1 deletion example/throw.js
Expand Up @@ -3,7 +3,7 @@ var test = require('../');

test('throw', function (t) {
t.plan(2);

setTimeout(function () {
throw new Error('doom');
}, 100);
Expand Down
4 changes: 2 additions & 2 deletions example/timing.js
Expand Up @@ -2,10 +2,10 @@ var test = require('../');

test('timing test', function (t) {
t.plan(2);

t.equal(typeof Date.now, 'function');
var start = new Date;

setTimeout(function () {
t.equal(new Date - start, 100);
}, 100);
Expand Down

0 comments on commit 6209882

Please sign in to comment.