fix(renderer): setAnsiColors is not a function

This commit is contained in:
Pooya Parsa 2018-03-19 19:56:56 +03:30
parent 03f3ff4517
commit 984788362a
3 changed files with 1 additions and 20 deletions

View File

@ -42,19 +42,6 @@ export const getContext = function getContext(req, res) {
return { req, res }
}
export const setAnsiColors = function setAnsiColors(ansiHTML) {
ansiHTML.setColors({
reset: ['efefef', 'a6004c'],
darkgrey: '5a012b',
yellow: 'ffab07',
green: 'aeefba',
magenta: 'ff84bf',
blue: '3505a0',
cyan: '56eaec',
red: '4e053a'
})
}
export const waitFor = function waitFor(ms) {
return new Promise(resolve => setTimeout(resolve, ms || 0))
}

View File

@ -12,7 +12,7 @@ import Debug from 'debug'
import connect from 'connect'
import launchMiddleware from 'launch-editor-middleware'
import { setAnsiColors, isUrl, waitFor, timeout } from '../common/utils'
import { isUrl, waitFor, timeout } from '../common/utils'
import defaults from '../common/nuxt.config'
import MetaRenderer from './meta'
@ -22,8 +22,6 @@ import nuxtMiddleware from './middleware/nuxt'
const debug = Debug('nuxt:render')
debug.color = 4 // Force blue color
setAnsiColors(ansiHTML)
let jsdom = null
export default class Renderer {

View File

@ -16,10 +16,6 @@ describe('utils', () => {
expect(ctx.res.b).toBe(2)
})
test('setAnsiColors', () => {
Utils.setAnsiColors(ansiHTML)
})
test('waitFor', async () => {
let s = Date.now()
await Utils.waitFor(100)