Skip to content

Commit

Permalink
fix: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed May 14, 2018
1 parent faeabee commit 3b1f2a5
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 31 deletions.
6 changes: 2 additions & 4 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
"env": {
"test": {
"plugins": [

"istanbul"
]
}
},
"plugins": [
"transform-flow-strip-types",
"transform-object-rest-spread"
"@babel/transform-flow-strip-types"
],
"presets": [
[
"env",
"@babel/env",
{
"targets": {
"node": 5
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ script:
- nyc report --reporter=text-lcov | coveralls
- nyc check-coverage --lines 70
after_success:
- export NODE_ENV=production
- npm run build
- semantic-release
notifications:
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
"url": "http://gajus.com"
},
"ava": {
"babel": "inherit",
"require": [
"babel-register"
"@babel/register"
]
},
"dependencies": {
Expand All @@ -19,13 +18,14 @@
},
"description": "Declarative DOM extraction expression evaluator.",
"devDependencies": {
"ava": "^0.25.0",
"babel-cli": "^6.26.0",
"@babel/cli": "^7.0.0-beta.46",
"@babel/core": "^7.0.0-beta.46",
"@babel/node": "^7.0.0-beta.46",
"@babel/plugin-transform-flow-strip-types": "^7.0.0-beta.46",
"@babel/preset-env": "^7.0.0-beta.46",
"@babel/register": "^7.0.0-beta.46",
"ava": "^1.0.0-beta.4",
"babel-plugin-istanbul": "^4.1.6",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.6.1",
"babel-register": "^6.26.0",
"coveralls": "^3.0.1",
"eslint": "^4.19.1",
"eslint-config-canonical": "^9.3.2",
Expand Down Expand Up @@ -63,7 +63,7 @@
"text-lcov"
],
"require": [
"babel-register"
"@babel/register"
],
"sourceMap": false
},
Expand All @@ -75,7 +75,7 @@
"build": "rm -fr ./dist && NODE_ENV=production babel ./src --out-dir ./dist --copy-files --source-maps && flow-copy-source src dist",
"lint": "eslint ./src ./test && flow",
"precommit": "npm run lint && npm run test",
"test": "ava --verbose"
"test": "ava --verbose --serial"
},
"version": "3.0.0"
}
5 changes: 1 addition & 4 deletions src/subroutines/testSubroutine.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import {
import {
InvalidValueSentinel
} from '../sentinels';
import type {
SubroutineType
} from '../types';

const testSubroutine: SubroutineType = (subject, [userRule]) => {
const testSubroutine = (subject: string, [userRule]: $ReadOnlyArray<string>) => {
const rule: RegExp = parseRegex(userRule);

if (typeof subject !== 'string') {
Expand Down
4 changes: 2 additions & 2 deletions test/surgeon/queries/multiple-matches.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ test('throws error if too few nodes are matched', (t): void => {
'select .foo {3,}'
];

t.throws(() => {
t.throws((): void => {
x(query, subject);
}, SelectSubroutineUnexpectedResultCountError);
});
Expand All @@ -109,7 +109,7 @@ test('throws error if too many nodes are matched', (t): void => {
'select .foo {0,2}'
];

t.throws(() => {
t.throws((): void => {
x(query, subject);
}, SelectSubroutineUnexpectedResultCountError);
});
4 changes: 2 additions & 2 deletions test/surgeon/queries/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ test('throws error if no nodes are matched', (t): void => {

const query: DenormalizedQueryType = 'select .foo | remove .qux | read property innerHTML';

t.throws(() => {
t.throws((): void => {
x(query, subject);
}, SelectSubroutineUnexpectedResultCountError);
});
Expand All @@ -121,7 +121,7 @@ test('throws error if more than one node is matched', (t): void => {

const query: DenormalizedQueryType = 'select .foo | remove .bar | read property innerHTML';

t.throws(() => {
t.throws((): void => {
x(query, subject);
}, SelectSubroutineUnexpectedResultCountError);
});
4 changes: 2 additions & 2 deletions test/surgeon/queries/single-match.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ test('throws error if no nodes are matched', (t): void => {
'select .foo'
];

t.throws(() => {
t.throws((): void => {
x(query, subject);
}, SelectSubroutineUnexpectedResultCountError);
});
Expand All @@ -88,7 +88,7 @@ test('throws error if more than one node is matched', (t): void => {
'select .foo'
];

t.throws(() => {
t.throws((): void => {
x(query, subject);
}, SelectSubroutineUnexpectedResultCountError);
});
Expand Down
4 changes: 2 additions & 2 deletions test/surgeon/subroutines/readSubroutine.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test('uses evalutor.isElement to validate the subject', (t): void => {
isElement
};

const error = t.throws(() => {
const error = t.throws((): void => {
readSubroutine(null, [], {evaluator});
});

Expand Down Expand Up @@ -53,7 +53,7 @@ test('using unknown target throws an error', (t): void => {
isElement
};

const result = t.throws(() => {
const result = t.throws((): void => {
readSubroutine(null, ['foo'], {evaluator});
});
Expand Down
6 changes: 1 addition & 5 deletions test/surgeon/subroutines/testSubroutine.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,12 @@ import {
import testSubroutine from '../../../src/subroutines/testSubroutine';

test('throws an error if invoked with invalid RegExp', (t): void => {
t.throws(() => {
// $FlowFixMe
t.throws((): void => {
testSubroutine('foo', ['/foo/x']);
});
});

test('validates the input agaisnt the regex', (t): void => {
// $FlowFixMe
t.true(testSubroutine('foo', ['foo']) === 'foo');

// $FlowFixMe
t.true(testSubroutine('foo', ['bar']) instanceof InvalidValueSentinel);
});

0 comments on commit 3b1f2a5

Please sign in to comment.