Skip to content

Commit

Permalink
Merge 491aaa3 into 5a0bf89
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Feb 9, 2018
2 parents 5a0bf89 + 491aaa3 commit 95518ca
Show file tree
Hide file tree
Showing 139 changed files with 23,680 additions and 18,171 deletions.
5 changes: 1 addition & 4 deletions .editorconfig
Expand Up @@ -3,11 +3,8 @@ root = true
[*]
end_of_line = lf
insert_final_newline = true
indent_size = 4
indent_size = 2
indent_style = space

[Makefile]
indent_style = tab

[*.json]
indent_size = 2
5 changes: 3 additions & 2 deletions .eslintrc.js
@@ -1,9 +1,10 @@
module.exports = {
extends: [
'onelint'
'pretty-standard'
],
plugins: ['import'],
plugins: ['prettier', 'import'],
rules: {
'prettier/prettier': 'error',
'import/no-extraneous-dependencies': [
'error', {
devDependencies: [ '**/test/**/*.js', '**/bootstrap-unexpected-markdown.js' ],
Expand Down
3 changes: 3 additions & 0 deletions .prettierrc
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -16,7 +16,7 @@ lint:
build/lib: lib/*
babel --copy-files --out-dir build/lib --quiet lib

build/test: test/*
build/test: $(shell find test -type f)
BABEL_ENV=test babel --copy-files --out-dir build/test --quiet test
sed -i -e 's#--require ./test#--require ./build/test#g' ./build/test/mocha.opts

Expand All @@ -38,7 +38,7 @@ create-html-runners: build/test test/tests.tpl.html test/JasmineRunner.tpl.html

.PHONY: create-html-runners

test-phantomjs: create-html-runners ${TARGETS}
test-phantomjs: build/test create-html-runners ${TARGETS}
phantomjs ./node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js build/test/tests.html spec "`node -pe 'JSON.stringify({useColors:true,grep:process.env.grep})'`"

test-jasmine:
Expand Down
14 changes: 7 additions & 7 deletions externaltests/assertionSucceedsWhilePromiseIsPending.spec.js
@@ -1,14 +1,14 @@
var expect = require('../lib');

expect.addAssertion('<any> to bar', function (expect, subject) {
expect(subject, 'to equal', 'bar');
return expect.promise(function (resolve, reject) {});
expect.addAssertion('<any> to bar', function(expect, subject) {
expect(subject, 'to equal', 'bar');
return expect.promise(function(resolve, reject) {});
});

expect.addAssertion('<any> to foo', function (expect) {
expect('bar', 'to bar');
expect.addAssertion('<any> to foo', function(expect) {
expect('bar', 'to bar');
});

it('should call the callback', function () {
expect('foo', 'to foo');
it('should call the callback', function() {
expect('foo', 'to foo');
});
22 changes: 12 additions & 10 deletions externaltests/deepObject.spec.js
@@ -1,12 +1,14 @@
var expect = require('../lib');
it('should not dot out the object in the diff', function () {
expect(function () {
expect({0: {0: {0: {0: {0: {0: {}}}}}}}, 'to equal', {});
}, 'to throw',
"expected { 0: { 0: { 0: { 0: { 0: { 0: ... } } } } } } to equal {}\n" +
"\n" +
"{\n" +
" 0: { 0: { 0: { 0: { 0: { 0: {} } } } } } // should be removed\n" +
"}"
);
it('should not dot out the object in the diff', function() {
expect(
function() {
expect({ 0: { 0: { 0: { 0: { 0: { 0: {} } } } } } }, 'to equal', {});
},
'to throw',
'expected { 0: { 0: { 0: { 0: { 0: { 0: ... } } } } } } to equal {}\n' +
'\n' +
'{\n' +
' 0: { 0: { 0: { 0: { 0: { 0: {} } } } } } // should be removed\n' +
'}'
);
});
22 changes: 14 additions & 8 deletions externaltests/failingAsync.spec.js
@@ -1,13 +1,19 @@
var expect = require('../lib');

expect.addAssertion('<any> when delayed a little bit <assertion?>', function (expect, subject) {
return expect.promise(function (run) {
setTimeout(run(function () {
return expect.shift();
}), 1);
});
expect.addAssertion('<any> when delayed a little bit <assertion?>', function(
expect,
subject
) {
return expect.promise(function(run) {
setTimeout(
run(function() {
return expect.shift();
}),
1
);
});
});

it('should magically change', function () {
return expect('abc', 'when delayed a little bit', 'to equal', 'def');
it('should magically change', function() {
return expect('abc', 'when delayed a little bit', 'to equal', 'def');
});
@@ -1,6 +1,6 @@
var expect = require('../lib');

it('should call the callback', function () {
expect(function () {}, 'to call the callback');
expect(true, 'to be falsy');
it('should call the callback', function() {
expect(function() {}, 'to call the callback');
expect(true, 'to be falsy');
});
@@ -1,5 +1,5 @@
var expect = require('../lib');

it('should call the callback', function () {
expect(function () {}, 'to call the callback');
it('should call the callback', function() {
expect(function() {}, 'to call the callback');
});
@@ -1,5 +1,5 @@
var expect = require('../lib');

it('should call the callback', function () {
expect(function () {}, 'to call the callback');
it('should call the callback', function() {
expect(function() {}, 'to call the callback');
});
16 changes: 8 additions & 8 deletions externaltests/forgotToReturnPromiseRejectedInTheNextTick.spec.js
@@ -1,12 +1,12 @@
var expect = require('../lib');

it('should fail', function () {
expect.addAssertion('<any> to foo', function (expect, subject) {
return expect.promise(function (resolve, reject) {
setImmediate(function () {
reject(new Error('argh'));
});
});
it('should fail', function() {
expect.addAssertion('<any> to foo', function(expect, subject) {
return expect.promise(function(resolve, reject) {
setImmediate(function() {
reject(new Error('argh'));
});
});
expect('bar', 'to foo');
});
expect('bar', 'to foo');
});
8 changes: 5 additions & 3 deletions externaltests/fullTrace.spec.js
@@ -1,5 +1,7 @@
var expect = require('../lib').clone().use(require('./node_modules/unexpected-bogus/index.js'));
var expect = require('../lib')
.clone()
.use(require('./node_modules/unexpected-bogus/index.js'));

it('should fail with a full trace', function () {
expect('abc', 'to be bogus');
it('should fail with a full trace', function() {
expect('abc', 'to be bogus');
});
8 changes: 4 additions & 4 deletions externaltests/node_modules/unexpected-bogus/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions externaltests/notToErrorCaughtError.spec.js
@@ -1,11 +1,11 @@
var expect = require('../lib');

it('should foo', function () {
return expect(function () {
return expect.promise(function () {
(function thisIsImportant() {
throw new Error('argh');
}());
});
}, 'not to error');
it('should foo', function() {
return expect(function() {
return expect.promise(function() {
(function thisIsImportant() {
throw new Error('argh');
})();
});
}, 'not to error');
});
4 changes: 2 additions & 2 deletions externaltests/successful.spec.js
@@ -1,5 +1,5 @@
var expect = require('../lib');

it('should call the callback', function () {
expect(true, 'to be true');
it('should call the callback', function() {
expect(true, 'to be true');
});
2 changes: 1 addition & 1 deletion lib/AssertionString.js
@@ -1,3 +1,3 @@
module.exports = function AssertionString(text) {
this.text = text;
this.text = text;
};

0 comments on commit 95518ca

Please sign in to comment.