mirror of
https://github.com/mjrode/WhatToWatch.git
synced 2025-12-21 13:00:35 -06:00
Setup istanbul and nyc for code coverage w/ babel 7
This commit is contained in:
9
.babelrc
9
.babelrc
@@ -1,11 +1,14 @@
|
||||
{
|
||||
"presets": [
|
||||
"@babel/preset-env"
|
||||
],"plugins": [
|
||||
["@babel/plugin-transform-runtime",
|
||||
],
|
||||
"plugins": [
|
||||
"istanbul",
|
||||
[
|
||||
"@babel/plugin-transform-runtime",
|
||||
{
|
||||
"regenerator": true
|
||||
}
|
||||
]
|
||||
],
|
||||
]
|
||||
}
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user