Last active
February 27, 2019 19:39
-
-
Save mjrode/dfc9ef2d844e64da4688d4ddf25b89f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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