Skip to content

Commit fd30997

Browse files
author
Anthony Du Pont
committed
🚧 Add Unit Test
1 parent f61b2c8 commit fd30997

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

test/core.tests.js

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import 'isomorphic-fetch';
55
// Dependencies
66
import sinon from 'sinon';
77
import chai from 'chai';
8-
import fetchMock from 'fetch-mock';
9-
import chaiFetchMock from 'chai-fetch-mock';
10-
11-
// Plugins
12-
chai.use(chaiFetchMock);
138

149
// Interface
1510
const { expect } = chai;
@@ -34,8 +29,6 @@ describe('Highway.Core', () => {
3429
document.body.appendChild(a);
3530
document.body.appendChild(b);
3631

37-
before(() => fetchMock.get('/foo', 'bar'));
38-
3932
it('Should be an instance of `Highway.Core`', () => {
4033
const Core = new Highway.Core();
4134

@@ -101,21 +94,9 @@ describe('Highway.Core', () => {
10194
const Core = new Highway.Core();
10295

10396
Core.unbind = sinon.spy();
97+
Core.state = { url: 'http://bar.com/foo' };
10498
Core.beforeFetch();
10599

106100
expect(Core.unbind.calledOnce).to.be.true;
107101
});
108-
109-
// it('Should fetch an URL properly', () => {
110-
// const Core = new Highway.Core();
111-
112-
// Core.state = { url: '/foo' };
113-
114-
// Core.fetch().then((response) => {
115-
// expect(response).to.equal('bar');
116-
// expect(fetchMock).route('/foo').to.have.been.called;
117-
// });
118-
// });
119-
120-
after(() => fetchMock.restore());
121102
});

0 commit comments

Comments
 (0)