@@ -2,14 +2,14 @@ jest.setTimeout(60000)
22
33const { Nuxt, Generator, Builder } = require ( 'nuxt-edge' )
44const request = require ( 'request-promise-native' )
5- const consola = require ( 'consola ' )
5+ const logger = require ( '@/logger ' )
66
77const config = require ( './fixture/nuxt.config' )
88config . dev = false
99
1010let nuxt
1111
12- consola . mockTypes ( ( ) => jest . fn ( ) )
12+ logger . mockTypes ( ( ) => jest . fn ( ) )
1313
1414const url = path => `http://localhost:3000${ path } `
1515const get = path => request ( url ( path ) )
@@ -23,7 +23,7 @@ const setupNuxt = async (config) => {
2323
2424describe ( 'module' , ( ) => {
2525 beforeEach ( ( ) => {
26- consola . warn . mockClear ( )
26+ logger . warn . mockClear ( )
2727 } )
2828
2929 afterEach ( async ( ) => {
@@ -54,7 +54,7 @@ describe('module', () => {
5454 await generator . initiate ( )
5555 await generator . initRoutes ( )
5656
57- expect ( consola . warn ) . toHaveBeenNthCalledWith ( 1 , 'The module `@nuxtjs/proxy` does not work in generated mode.' )
57+ expect ( logger . warn ) . toHaveBeenCalledWith ( 'The module `@nuxtjs/proxy` does not work in generated mode.' )
5858 } )
5959
6060 test ( 'generate spa mode' , async ( ) => {
@@ -70,7 +70,7 @@ describe('module', () => {
7070 await generator . initiate ( )
7171 await generator . initRoutes ( )
7272
73- expect ( consola . warn ) . not . toHaveBeenCalled ( )
73+ expect ( logger . warn ) . not . toHaveBeenCalled ( )
7474 } )
7575
7676 test ( 'object mode' , async ( ) => {
@@ -107,6 +107,8 @@ describe('module', () => {
107107 proxy : false
108108 } )
109109
110+ expect ( logger . warn ) . toHaveBeenCalledWith ( 'No proxy defined on top level.' )
111+
110112 await expect ( await get ( '/proxy/aaa' ) ) . toBe ( 'url:/proxy/aaa' )
111113 } )
112114} )
0 commit comments