mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
test: add unit tests for core/resolver.js (#5790)
This commit is contained in:
parent
59071e4c6d
commit
6e9cf8e394
@ -428,6 +428,19 @@ describe('core: resolver', () => {
|
|||||||
expect(() => resolver.requireModule('/var/nuxt/resolver/module.js')).toThrow('resolve esm failed')
|
expect(() => resolver.requireModule('/var/nuxt/resolver/module.js')).toThrow('resolve esm failed')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('should display deprecated intropDefault options', () => {
|
||||||
|
const resolver = new Resolver({
|
||||||
|
options: {}
|
||||||
|
})
|
||||||
|
resolver.resolvePath = x => x
|
||||||
|
resolver.esm = jest.fn()
|
||||||
|
|
||||||
|
resolver.requireModule('/var/nuxt/resolver/file.js', { intropDefault: true })
|
||||||
|
const warnMsg = 'Using intropDefault is deprecated and will be removed in Nuxt 3. Use `interopDefault` instead.'
|
||||||
|
expect(consola.warn).toBeCalledTimes(1)
|
||||||
|
expect(consola.warn).toBeCalledWith(warnMsg)
|
||||||
|
})
|
||||||
|
|
||||||
test('should display deprecated alias options', () => {
|
test('should display deprecated alias options', () => {
|
||||||
const resolver = new Resolver({
|
const resolver = new Resolver({
|
||||||
options: {}
|
options: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user