Skip to content

Commit

Permalink
update sinon version
Browse files Browse the repository at this point in the history
  • Loading branch information
joaaomanooel committed Nov 27, 2018
1 parent 64f4834 commit d76afb9
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 610 deletions.
18 changes: 8 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,29 +52,27 @@
},
"homepage": "https://github.com/joaaomanooel/spotify-wrapper#readme",
"devDependencies": {
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"@babel/register": "^7.0.0",
"babel-loader": "^8.0.4",
"chai": "^4.1.2",
"chai": "^4.2.0",
"coveralls": "^3.0.2",
"eslint": "^5.9.0",
"eslint-config-airbnb-base": "^13.1.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^6.1.2",
"eslint-plugin-react": "^7.11.1",
"husky": "^1.2.0",
"mocha": "^5.1.1",
"node-fetch": "^2.1.2",
"nyc": "^11.8.0",
"mocha": "^5.2.0",
"node-fetch": "^2.3.0",
"nyc": "^13.1.0",
"rimraf": "^2.6.2",
"sinon": "^4.5.0",
"sinon-chai": "^3.0.0",
"sinon-stub-promise": "^4.0.0",
"sinon": "^7.1.1",
"sinon-chai": "^3.3.0",
"webpack": "^4.26.1",
"webpack-cli": "^3.1.2"
},
"dependencies": {
"@babel/cli": "^7.1.5"
}
"dependencies": {}
}
17 changes: 7 additions & 10 deletions tests/album.spec.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
import chai, { expect } from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import sinonStubPromise from 'sinon-stub-promise';
import SpotifyWrapper from '../src/index';


global.fetch = require('node-fetch');

chai.use(sinonChai);
sinonStubPromise(sinon);

describe('Album', () => {
let fetchedStub;
let promise;
let spotify;

beforeEach(() => {
Expand All @@ -21,7 +18,7 @@ describe('Album', () => {
});

fetchedStub = sinon.stub(global, 'fetch');
promise = fetchedStub.returnsPromise();
fetchedStub.resolves({ json: () => ({ album: 'name' }) });
});

afterEach(() => {
Expand Down Expand Up @@ -53,9 +50,9 @@ describe('Album', () => {
});

it('Should return the JSON Data from the Promise', () => {
promise.resolves({ album: 'name' });
const album = spotify.album.getAlbum('4aawyAB9vmqN3uQ7FjRGTy');
expect(album.resolveValue).to.be.eql({ album: 'name' });
album
.then(data => expect(data).to.be.eql({ album: 'name' }));
});
});

Expand All @@ -72,9 +69,9 @@ describe('Album', () => {
});

it('Should return the JSON Data from the Promise', () => {
promise.resolves({ album: 'name' });
const albums = spotify.album.getAlbums(['4aawyAB9vmqN3uQ7FjRGTy', '4aawyAB9vmqN3uQ7FjRGTas']);
expect(albums.resolveValue).to.be.eql({ album: 'name' });
albums
.then(data => expect(data).to.be.eql({ album: 'name' }));
});
});

Expand All @@ -91,9 +88,9 @@ describe('Album', () => {
});

it('Should return the JSON Data from the Promise', () => {
promise.resolves({ album: 'name' });
const albums = spotify.album.getAlbumTraks('4aawyAB9vmqN3uQ7FjRGTy');
expect(albums.resolveValue).to.be.eql({ album: 'name' });
albums
.then(data => expect(data).to.be.eql({ album: 'name' }));
});
});
});
2 changes: 0 additions & 2 deletions tests/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import chai, { expect } from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import sinonStubPromise from 'sinon-stub-promise';
import SpotifyWrapper from '../src/index';

global.fetch = require('node-fetch');

chai.use(sinonChai);
sinonStubPromise(sinon);

describe('SpotifyWrapper Library', () => {
it('should crate an instance of SpotifyWrapper', () => {
Expand Down
2 changes: 0 additions & 2 deletions tests/search.spec.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import chai, { expect } from 'chai';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';
import sinonStubPromise from 'sinon-stub-promise';
import SpotifyWrapper from '../src/index';

global.fetch = require('node-fetch');

chai.use(sinonChai);
sinonStubPromise(sinon);

describe('Search', () => {
let fetchedStub;
Expand Down
Loading

0 comments on commit d76afb9

Please sign in to comment.