Skip to content

Commit ef8983a

Browse files
Bump dependencies (preactjs#292)
Bump dependencies
2 parents 758d044 + 4bf702f commit ef8983a

File tree

5 files changed

+38
-36
lines changed

5 files changed

+38
-36
lines changed

karma.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = function(config) {
22
config.set({
33
frameworks: ['mocha', 'chai-sinon'],
44
reporters: ['mocha'],
5-
browsers: ['PhantomJS'],
5+
browsers: ['ChromeHeadless'],
66

77
files: ['test/**/*.js'],
88

package.json

+10-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"transpile:match": "babel src/match.js -o match.js -f umd",
1515
"size": "size=$(gzip-size $npm_package_main) && echo \"gzip size: $size / $(pretty-bytes $size)\"",
1616
"test": "npm-run-all lint build test:karma test:ts",
17-
"lint": "eslint {src,test,test_helpers}",
17+
"lint": "eslint ./{src,test,test_helpers}/**/*.js",
18+
"fix": "npm run lint -- --fix",
1819
"test:karma": "karma start --single-run",
1920
"test:watch": "karma start",
2021
"test:ts": "tsc -p ./test",
@@ -61,30 +62,31 @@
6162
"chai": "^3.5.0",
6263
"copyfiles": "^1.0.0",
6364
"diff": "^3.0.0",
64-
"eslint": "^3.0.0",
65+
"eslint": "^5.8.0",
6566
"eslint-plugin-react": "^6.0.0",
6667
"gzip-size-cli": "^1.0.0",
67-
"karma": "^1.0.0",
68+
"karma": "^3.1.1",
6869
"karma-chai-sinon": "^0.1.5",
69-
"karma-mocha": "^1.0.1",
70-
"karma-mocha-reporter": "^2.0.3",
71-
"karma-phantomjs-launcher": "^1.0.0",
70+
"karma-chrome-launcher": "^2.2.0",
71+
"karma-mocha": "^1.3.0",
72+
"karma-mocha-reporter": "^2.2.5",
7273
"karma-sourcemap-loader": "^0.3.7",
7374
"karma-webpack": "^2.0.1",
7475
"mkdirp": "^0.5.1",
75-
"mocha": "^3.0.0",
76+
"mocha": "^5.2.0",
7677
"npm-run-all": "^3.0.0",
7778
"phantomjs-prebuilt": "^2.1.7",
7879
"preact": "^10.0.0-beta.0",
7980
"pretty-bytes-cli": "^1.0.0",
81+
"puppeteer": "^1.9.0",
8082
"rimraf": "^2.5.1",
8183
"rollup": "^0.41.6",
8284
"rollup-plugin-buble": "^0.15.0",
8385
"rollup-plugin-es3": "^1.0.3",
8486
"rollup-plugin-memory": "^2.0.0",
8587
"rollup-plugin-post-replace": "^1.0.0",
8688
"rollup-plugin-uglify": "^1.0.1",
87-
"sinon": "^1.17.4",
89+
"sinon": "^7.1.0",
8890
"sinon-chai": "^2.8.0",
8991
"typescript": "^3.4.4",
9092
"webpack": "^1.13.1"

src/util.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export function exec(url, route, opts) {
2626
let max = Math.max(url.length, route.length);
2727
for (let i=0; i<max; i++) {
2828
if (route[i] && route[i].charAt(0)===':') {
29-
let param = route[i].replace(/(^\:|[+*?]+$)/g, ''),
29+
let param = route[i].replace(/(^:|[+*?]+$)/g, ''),
3030
flags = (route[i].match(/[+*?]+$/) || EMPTY)[0] || '',
3131
plus = ~flags.indexOf('+'),
3232
star = ~flags.indexOf('*'),
@@ -53,8 +53,8 @@ export function exec(url, route, opts) {
5353
export function pathRankSort(a, b) {
5454
return (
5555
(a.rank < b.rank) ? 1 :
56-
(a.rank > b.rank) ? -1 :
57-
(a.index - b.index)
56+
(a.rank > b.rank) ? -1 :
57+
(a.index - b.index)
5858
);
5959
}
6060

test/dom.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('dom', () => {
5454
</Router>
5555
</div>
5656
);
57-
onChange.reset();
57+
onChange.resetHistory();
5858
$('a').click();
5959
expect(onChange)
6060
.to.have.been.calledOnce
@@ -73,7 +73,7 @@ describe('dom', () => {
7373
</Router>
7474
</div>
7575
);
76-
onChange.reset();
76+
onChange.resetHistory();
7777
$('a').click();
7878
// fireEvent($('a'), 'click');
7979
expect(onChange)
@@ -91,7 +91,7 @@ describe('dom', () => {
9191
</Router>
9292
</div>
9393
);
94-
onChange.reset();
94+
onChange.resetHistory();
9595
$('a').click();
9696
expect(onChange).not.to.have.been.called;
9797
expect(location.href).to.contain('#foo');
@@ -143,7 +143,7 @@ describe('dom', () => {
143143
expect(A.prototype.componentWillMount).not.to.have.been.called;
144144
route('/a');
145145
expect(A.prototype.componentWillMount).to.have.been.calledOnce;
146-
A.prototype.componentWillMount.reset();
146+
A.prototype.componentWillMount.resetHistory();
147147
expect(location.pathname).to.equal('/b');
148148
setTimeout( () => {
149149
expect(A.prototype.componentWillMount).not.to.have.been.called;
@@ -171,7 +171,7 @@ describe('dom', () => {
171171
expect(routerRef.base.outerHTML).to.eql('<p>bar is </p>');
172172
});
173173
});
174-
174+
175175
describe('preact-router/match', () => {
176176
describe('<Match>', () => {
177177
it('should invoke child function with match status when routing', done => {
@@ -184,35 +184,35 @@ describe('dom', () => {
184184
<Match path="/bar">{spy2}</Match>
185185
</div>
186186
);
187-
187+
188188
expect(spy1, 'spy1 /foo').to.have.been.calledOnce.and.calledWithMatch({ matches: false, path:'/', url:'/' });
189189
expect(spy2, 'spy2 /foo').to.have.been.calledOnce.and.calledWithMatch({ matches: false, path:'/', url:'/' });
190-
191-
spy1.reset();
192-
spy2.reset();
193-
190+
191+
spy1.resetHistory();
192+
spy2.resetHistory();
193+
194194
route('/foo');
195-
195+
196196
setTimeout( () => {
197197
expect(spy1, 'spy1 /foo').to.have.been.calledOnce.and.calledWithMatch({ matches: true, path:'/foo', url:'/foo' });
198198
expect(spy2, 'spy2 /foo').to.have.been.calledOnce.and.calledWithMatch({ matches: false, path:'/foo', url:'/foo' });
199-
spy1.reset();
200-
spy2.reset();
201-
199+
spy1.resetHistory();
200+
spy2.resetHistory();
201+
202202
route('/foo?bar=5');
203203

204204
setTimeout( () => {
205205
expect(spy1, 'spy1 /foo?bar=5').to.have.been.calledOnce.and.calledWithMatch({ matches: true, path:'/foo', url:'/foo?bar=5' });
206206
expect(spy2, 'spy2 /foo?bar=5').to.have.been.calledOnce.and.calledWithMatch({ matches: false, path:'/foo', url:'/foo?bar=5' });
207-
spy1.reset();
208-
spy2.reset();
207+
spy1.resetHistory();
208+
spy2.resetHistory();
209209

210210
route('/bar');
211-
211+
212212
setTimeout( () => {
213213
expect(spy1, 'spy1 /bar').to.have.been.calledOnce.and.calledWithMatch({ matches: false, path:'/bar', url:'/bar' });
214214
expect(spy2, 'spy2 /bar').to.have.been.calledOnce.and.calledWithMatch({ matches: true, path:'/bar', url:'/bar' });
215-
215+
216216
done();
217217
}, 20);
218218
}, 20);
@@ -230,7 +230,7 @@ describe('dom', () => {
230230
</div>
231231
);
232232
route('/foo');
233-
233+
234234
setTimeout( () => {
235235
expect(scratch.innerHTML).to.eql('<div><a class="active">foo</a><a class="bar">bar</a></div>');
236236

@@ -243,7 +243,7 @@ describe('dom', () => {
243243

244244
setTimeout( () => {
245245
expect(scratch.innerHTML).to.eql('<div><a class="">foo</a><a class="bar active">bar</a></div>');
246-
246+
247247
done();
248248
});
249249
});

test/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,21 +141,21 @@ describe('preact-router', () => {
141141
});
142142

143143
it('should return true for existing route', () => {
144-
router.routeTo.reset();
144+
router.routeTo.resetHistory();
145145
expect(route('/')).to.equal(true);
146146
expect(router.routeTo)
147147
.to.have.been.calledOnce
148148
.and.calledWithExactly('/');
149149

150-
router.routeTo.reset();
150+
router.routeTo.resetHistory();
151151
expect(route('/foo')).to.equal(true);
152152
expect(router.routeTo)
153153
.to.have.been.calledOnce
154154
.and.calledWithExactly('/foo');
155155
});
156156

157157
it('should return false for missing route', () => {
158-
router.routeTo.reset();
158+
router.routeTo.resetHistory();
159159
expect(route('/asdf')).to.equal(false);
160160
expect(router.routeTo)
161161
.to.have.been.calledOnce
@@ -169,7 +169,7 @@ describe('preact-router', () => {
169169
...oldChildren
170170
];
171171

172-
router.routeTo.reset();
172+
router.routeTo.resetHistory();
173173
expect(route('/asdf')).to.equal(true);
174174
expect(router.routeTo)
175175
.to.have.been.calledOnce

0 commit comments

Comments
 (0)