Skip to content

Commit

Permalink
Merge d381525 into 164099a
Browse files Browse the repository at this point in the history
  • Loading branch information
sunesimonsen committed Mar 13, 2019
2 parents 164099a + d381525 commit fd1d3ba
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 46 deletions.
26 changes: 19 additions & 7 deletions .babelrc
@@ -1,23 +1,35 @@
{
"sourceType": "script",
"generatorOpts": {
"retainLines": true
},
"env": {
"development": {
"presets": [
"es2015-without-strict"
[
"@babel/preset-env",
{
}
]
],
"plugins": [
["transform-runtime", {
"polyfill": false
["@babel/plugin-transform-runtime", {
"modules": false
}]
]
},
"test": {
"presets": [
"es2015-without-strict"
[
"@babel/preset-env",
{
}
]
],
"plugins": [
["transform-runtime", {
"polyfill": false,
"helpers": false
["@babel/plugin-transform-runtime", {
"helpers": false,
"modules": false
}]
]
}
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -16,14 +16,14 @@ lint:
.PHONY: lint

build/lib: lib/*
./node_modules/.bin/babel --copy-files --out-dir build/lib --quiet lib
./node_modules/.bin/babel --copy-files --out-dir build/lib lib

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

build/externaltests: externaltests/*
./node_modules/.bin/babel --copy-files --out-dir build/externaltests --quiet externaltests
./node_modules/.bin/babel --copy-files --out-dir build/externaltests externaltests

build: build/lib build/test build/externaltests

Expand Down
16 changes: 9 additions & 7 deletions package.json
Expand Up @@ -24,7 +24,6 @@
"dependencies": {
"array-changes": "3.0.1",
"array-changes-async": "3.0.1",
"babel-runtime": "6.26.0",
"detect-indent": "3.0.1",
"diff": "4.0.1",
"greedy-interval-packer": "1.2.0",
Expand All @@ -33,9 +32,10 @@
"unexpected-bluebird": "2.9.34-longstack2"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-es2015-without-strict": "^0.0.4",
"@babel/cli": "^7.2.3",
"@babel/plugin-transform-runtime": "^7.2.0",
"@babel/preset-env": "^7.3.1",
"@babel/runtime": "^7.3.1",
"coveralls": "^3.0.0",
"eslint": "^5.11.1",
"eslint-config-prettier": "^4.0.0",
Expand All @@ -51,7 +51,7 @@
"istanbul": "^0.4.5",
"jasmine": "~3.3.1",
"jasmine-core": "^3.1.0",
"jest": "^23.0.0",
"jest": "^24.5.0",
"karma": "4.0.1",
"karma-browserstack-launcher": "1.4.0",
"karma-chrome-launcher": "2.2.0",
Expand Down Expand Up @@ -89,9 +89,11 @@
"setupFiles": [
"<rootDir>/test/promisePolyfill"
],
"setupTestFrameworkScriptFile": "<rootDir>/test/common.js",
"setupFilesAfterEnv": [
"<rootDir>/test/common.js"
],
"testMatch": [
"<rootDir>/test/**.spec.js"
"<rootDir>/test/**/*.spec.js"
],
"testURL": "http://localhost/",
"transformIgnorePatterns": [
Expand Down
41 changes: 17 additions & 24 deletions test/assertions/to-be-fulfilled-with-value-satisfying.spec.js
Expand Up @@ -156,42 +156,35 @@ describe('to be fulfilled with value satisfying assertion', () => {
});

it('errors with the correct error', () => {
// Helper function to prevent function inspection from differing
// when the test suite has been through babel:
function makePromise() {
return Promise.resolve({
foo: 'foo',
bar: 'bar'
});
}
return expect(
function() {
return expect(
function() {
return Promise.resolve({
foo: 'foo',
bar: 'bar',
quux: 'quux'
});
},
// prettier-ignore
function() { return makePromise(); },
'to be fulfilled with value exhaustively satisfying',
{
foo: 'foo',
bar: 'bar'
foo: 'foo'
}
);
},
'to be rejected with',
'expected\n' +
'function () {\n' +
' return Promise.resolve({\n' +
" foo: 'foo',\n" +
" bar: 'bar',\n" +
" quux: 'quux'\n" +
' });\n' +
'}\n' +
"to be fulfilled with value exhaustively satisfying { foo: 'foo', bar: 'bar' }\n" +
" expected Promise (fulfilled) => { foo: 'foo', bar: 'bar', quux: 'quux' }\n" +
" to be fulfilled with value exhaustively satisfying { foo: 'foo', bar: 'bar' }\n" +
" expected { foo: 'foo', bar: 'bar', quux: 'quux' }\n" +
" to exhaustively satisfy { foo: 'foo', bar: 'bar' }\n" +
'expected function () { return makePromise(); }\n' +
"to be fulfilled with value exhaustively satisfying { foo: 'foo' }\n" +
" expected Promise (fulfilled) => { foo: 'foo', bar: 'bar' }\n" +
" to be fulfilled with value exhaustively satisfying { foo: 'foo' }\n" +
" expected { foo: 'foo', bar: 'bar' } to exhaustively satisfy { foo: 'foo' }\n" +
'\n' +
' {\n' +
" foo: 'foo',\n" +
" bar: 'bar',\n" +
" quux: 'quux' // should be removed\n" +
" bar: 'bar' // should be removed\n" +
' }'
);
});
Expand Down
10 changes: 5 additions & 5 deletions test/types/function-type.spec.js
Expand Up @@ -71,11 +71,11 @@ describe('function type', () => {
expect(
// prettier-ignore
function() {
var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;a = 456;
var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;
},
'to inspect as',
'function () {\n' +
' var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;a = 456;\n' +
' var a = 123 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2;\n' +
'}'
);
/* eslint-enable no-unused-vars */
Expand All @@ -93,10 +93,10 @@ describe('function type', () => {
expect(
// prettier-ignore
function() {
var a = 123;a = 456; // foo
},
var a = 123; // foo
},
'to inspect as',
'function () {\n' + ' var a = 123;a = 456; // foo\n' + '}'
'function () {\n' + ' var a = 123; // foo\n' + '}'
);
/* eslint-enable no-unused-vars */
});
Expand Down

0 comments on commit fd1d3ba

Please sign in to comment.