Setup istanbul and nyc for code coverage w/ babel 7

This commit is contained in:
Mike Rode
2019-09-05 22:07:56 -05:00
parent 45f3a0d192
commit be7e2f8fd5
3 changed files with 17 additions and 9 deletions

View File

@@ -1,11 +1,14 @@
{
"presets": [
"@babel/preset-env"
],"plugins": [
["@babel/plugin-transform-runtime",
],
"plugins": [
"istanbul",
[
"@babel/plugin-transform-runtime",
{
"regenerator": true
}
]
],
]
}

View File

@@ -39,7 +39,7 @@ describe('auth.controller', () => {
});
describe('GET /api/auth/google', async () => {
it.only('should not find the current user in the database before auth', done => {
it('should not find the current user in the database before auth', done => {
const userLookup = models.User.findOne({
where: { email: 'michaelrode44@gmail.com' },
});
@@ -50,7 +50,7 @@ describe('auth.controller', () => {
describe('When a user successfully auths with google', () => {
describe('The user has not previously registered', () => {
it.only('should create a new user record in the datbase and return the user record', done => {
it('should create a new user record in the datbase and return the user record', done => {
let strategy = passport._strategies['google'];
strategy._token_response = {

View File

@@ -18,7 +18,9 @@ describe('plexApi', () => {
it('returns url', () => {
const urlParams = plexApi.getUsersUrlParams();
const url = helpers.buildUrl(urlParams);
url.should.equal('https://plex.tv/api/users?X-Plex-Token=testPlexApiToken');
url.should.equal(
'https://plex.tv/api/users?X-Plex-Token=testPlexApiToken',
);
});
it('handles error when building url', () => {
@@ -45,13 +47,16 @@ describe('plexApi', () => {
it('returns library data by sectionId', async () => {
nocks.plexLibrary();
const result = await plexApi.getLibraryDataBySection({ sectionId: 2 });
const result = await plexApi.getLibraryDataBySection({
sectionId: 2,
});
result.should.deep.equal(
plexResponses.getLibraryDataBySectionRaw.MediaContainer.Metadata,
plexResponses.getLibraryDataBySectionRaw.MediaContainer
.Metadata,
);
});
// it.only('handles error if passed incorrect parameters', async (done) => {
// it('handles error if passed incorrect parameters', async (done) => {
// try {
// await plexApi.getLibraryDataBySection('incorrect param');
// } catch (error) {