From 6e9cf8e394c89b1f6158e2fd636ad9a648c2fe02 Mon Sep 17 00:00:00 2001 From: cui_xiaorui Date: Thu, 23 May 2019 16:10:18 +0800 Subject: [PATCH] test: add unit tests for core/resolver.js (#5790) --- packages/core/test/resolver.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/core/test/resolver.test.js b/packages/core/test/resolver.test.js index 1ce35ffb15..5942393d50 100644 --- a/packages/core/test/resolver.test.js +++ b/packages/core/test/resolver.test.js @@ -428,6 +428,19 @@ describe('core: resolver', () => { 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', () => { const resolver = new Resolver({ options: {}