mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 14:15:13 +00:00
c7ea13ea9f
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
34 lines
732 B
JavaScript
34 lines
732 B
JavaScript
import { consola } from '../utils'
|
|
import { showBanner } from '../../src/utils/banner'
|
|
|
|
jest.mock('std-env', () => ({
|
|
isTest: false,
|
|
isMinimal: true
|
|
}))
|
|
|
|
describe('cli/utils', () => {
|
|
afterEach(() => jest.resetAllMocks())
|
|
|
|
test('showBanner prints only listeners', () => {
|
|
const listeners = [
|
|
{ url: 'first' },
|
|
{ url: 'second' }
|
|
]
|
|
|
|
showBanner({
|
|
options: {
|
|
cli: {
|
|
bannerColor: 'green'
|
|
}
|
|
},
|
|
server: {
|
|
listeners
|
|
}
|
|
})
|
|
|
|
expect(consola.info).toHaveBeenCalledTimes(2)
|
|
expect(consola.info).toHaveBeenCalledWith(`Listening on: ${listeners[0].url}`)
|
|
expect(consola.info).toHaveBeenCalledWith(`Listening on: ${listeners[1].url}`)
|
|
})
|
|
})
|