Skip to content

Commit 92aae5d

Browse files
committed
test: add test for overriding custom options
* be0c16c
1 parent d6e2be8 commit 92aae5d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/module.test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { readFileSync } from 'fs'
22
import { resolve } from 'path'
33
import { setupTest, get, generate, getNuxt } from '@nuxt/test-utils'
44

5+
import * as validator from '../src/validator'
6+
57
const mockReporter = {
68
error: jest.fn(),
79
info: jest.fn(),
@@ -48,3 +50,25 @@ describe('Nuxt module', () => {
4850
)
4951
}, 50000)
5052
})
53+
54+
describe('custom options', () => {
55+
setupTest({
56+
testDir: __dirname,
57+
fixture: '../example',
58+
config: {
59+
htmlValidator: {
60+
options: {
61+
extends: []
62+
}
63+
}
64+
}
65+
})
66+
67+
jest.spyOn(validator, 'useValidator')
68+
69+
test('overriding extends does not merge array', () => {
70+
expect(validator.useValidator).toHaveBeenCalledWith(expect.objectContaining({
71+
extends: []
72+
}))
73+
}, 50000)
74+
})

0 commit comments

Comments
 (0)