Skip to content

Commit

Permalink
chore(#693): update druxt-blocks tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Decipher committed Aug 13, 2024
1 parent bb5a6cc commit 9ff5ade
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 25 deletions.
25 changes: 25 additions & 0 deletions packages/blocks/test/nuxt/index.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import DruxtBlocksNuxtModule from '../../src/nuxt'

// jest.mock('../src/nuxt/storybook')

jest.mock('@nuxt/kit', () => ({
defineNuxtModule: (module) => module,
installModule: jest.fn(),
}))

const nuxtMock = {
hook: jest.fn((hook, fn) => {
const arg = {
'components:dirs': [],
// 'storybook:config': { stories: [] }
}
return fn(arg[hook])
}),
}

test('Nuxt module', async () => {
nuxtMock.options = {
druxt: {}
}
await DruxtBlocksNuxtModule.setup({}, nuxtMock)
})
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import DruxtBlocksStorybook from '../src/nuxtStorybook'
import DruxtBlocksStorybook from '../../src/nuxt/storybook'

jest.mock('axios')

jest.mock('@nuxt/kit', () => ({
addTemplate: jest.fn(),
defineNuxtModule: (module) => module,
}))

const mock = {
addTemplate: jest.fn(),
options: {
Expand Down
24 changes: 0 additions & 24 deletions packages/blocks/test/nuxtModule.test.js

This file was deleted.

0 comments on commit 9ff5ade

Please sign in to comment.