Skip to content

Instantly share code, notes, and snippets.

@mjrode
Last active February 27, 2019 19:39
Show Gist options
  • Save mjrode/dfc9ef2d844e64da4688d4ddf25b89f3 to your computer and use it in GitHub Desktop.
Save mjrode/dfc9ef2d844e64da4688d4ddf25b89f3 to your computer and use it in GitHub Desktop.
import chai from 'chai';
import nock from 'nock';
import app from '../../../../index';
import importData from '../../../../server/services/plex/importData';
import models from '../../../../server/db/models';
import { seed, truncate } from '../../../../server/db/scripts';
import * as nocks from '../../../nocks';
// // before(() => truncate('PlexSection'));
describe('ImportData', () => {
before(() => {
nocks.plexSections();
seed('User');
});
after(() => {
truncate('User');
truncate('PlexLibrary');
truncate('PlexSection');
});
describe('GET /plex/import/sections', () => {
it('should find and store sections in the database', async () => {
const response = await importData.importSections();
console.log('import sec response', response);
const sections = await models.PlexSection.findAll();
console.log('Sections response', sections);
sections.should.be.length(2);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment