[wip] Trying to fix travis

This commit is contained in:
Kylart 2018-08-08 23:51:05 +02:00
parent 2d7797b329
commit 46ee86b43e
10 changed files with 11 additions and 10 deletions

View File

@ -6,7 +6,7 @@ import { readFileSync } from 'fs'
import { DIR, makeApp } from './utils.js'
import clean from '../clean.js'
test.after('Cleaning', clean)
test.after.cb('Cleaning', clean)
test('/getConfig.json route exits and returns json with right keys', async (t) => {
const { body: data } = await request(makeApp())

View File

@ -4,7 +4,7 @@ import request from 'supertest'
import { makeApp } from './utils.js'
import clean from '../clean.js'
test.after('Cleaning', clean)
test.after.cb('Cleaning', clean)
test('/_env route exits and return string containing platform\'s name', async (t) => {
const { body, status } = await request(makeApp()).get('/_env')

View File

@ -5,7 +5,7 @@ import { join } from 'path'
import { makeApp, DIR } from './utils.js'
import clean from '../clean.js'
test.after('Cleaning', clean)
test.after.cb('Cleaning', clean)
test('/getHistory route exits and returns history file', async (t) => {
const { body, status } = await request(makeApp()).get('/getHistory')

View File

@ -14,7 +14,7 @@ import clean from '../clean.js'
import { makeApp, kawAnimeFilesPath } from './utils.js'
test.afterEach.always('Cleaning...', clean)
test.afterEach.always.cb('Cleaning', clean)
test('KawAnime\'s needed files are generated if not there.', async (t) => {
t.plan(5)

View File

@ -6,7 +6,7 @@ import { join } from 'path'
import { makeApp, DIR } from './utils.js'
import clean from '../clean.js'
test.after('Cleaning', clean)
test.after.cb('Cleaning', clean)
test.before((t) => {
makeApp()

View File

@ -4,7 +4,7 @@ import request from 'supertest'
import { makeApp } from './utils.js'
import clean from '../clean.js'
test.after('Cleaning', clean)
test.after.cb('Cleaning', clean)
test.skip('/getWatchList route exits and return an array containing entries', async t => {
const { body, status } = await request(makeApp())

View File

@ -4,7 +4,7 @@ import request from 'supertest'
import { makeApp } from './utils.js'
import clean from '../clean.js'
test.after('Cleaning', clean)
test.after.cb('Cleaning', clean)
test.beforeEach.cb((t) => {
setTimeout(t.end, 5 * 1000)

View File

@ -4,6 +4,6 @@ import test from 'ava'
// import { makeApp } from './utils.js'
// import clean from '../clean.js'
// test.after('Cleaning', clean)
// test.after.cb('Cleaning', clean)
test.todo('Make tests?')

View File

@ -6,7 +6,7 @@ import { join } from 'path'
import clean from '../clean.js'
import { makeApp, kawAnimeFilesPath } from './utils.js'
test.afterEach.always(clean)
test.afterEach.always.cb('Cleaning', clean)
test('/_setupCreds route exits and creates a bcup file along the master key which are retrievable', async (t) => {
t.plan(3)

View File

@ -5,10 +5,11 @@ const chalk = require('chalk')
const DIR = join(homedir(), '.KawAnime-test')
module.exports = () => {
module.exports = (cb) => {
rimraf(DIR, (err) => {
if (err) throw err
console.log(chalk.green('> Cleared testing directory.'))
cb && cb.end()
})
}