tests: update paths
This commit is contained in:
parent
bfed434a4e
commit
9c1741aac5
1 changed files with 5 additions and 5 deletions
|
|
@ -5,7 +5,7 @@ import { dirname, resolve } from 'node:path'
|
|||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||
import { consola } from 'consola'
|
||||
|
||||
import newNow from '../commands/prep-now'
|
||||
import newNow from '../scripts/prep-now'
|
||||
|
||||
// Mock file system operations
|
||||
vi.mock('path', () => ({
|
||||
|
|
@ -27,7 +27,7 @@ vi.mock('consola', () => ({
|
|||
}))
|
||||
|
||||
// Mock mdToHTML
|
||||
vi.mock('../command/md-to-html', () => ({
|
||||
vi.mock('../scripts/md-to-html', () => ({
|
||||
mdToHTML: vi.fn(),
|
||||
}))
|
||||
|
||||
|
|
@ -56,7 +56,7 @@ describe('prep-now', () => {
|
|||
|
||||
it('should create a new now page and clear the original files', async () => {
|
||||
// Mock the mdToHTML function
|
||||
const { mdToHTML } = await import('../utils/md-to-html')
|
||||
const { mdToHTML } = await import('../scripts/md-to-html')
|
||||
vi.mocked(mdToHTML).mockResolvedValue('<h1>Test Content</h1>')
|
||||
|
||||
// Mock file paths
|
||||
|
|
@ -73,8 +73,8 @@ describe('prep-now', () => {
|
|||
.mockReturnValueOnce('# Test Content')
|
||||
|
||||
// Mock file paths
|
||||
const __filename = '/src/commands/prep-now.ts'
|
||||
const __dirname = '/src/commands'
|
||||
const __filename = '/src/scripts/prep-now.ts'
|
||||
const __dirname = '/src/scripts'
|
||||
vi.mocked(fileURLToPath).mockReturnValue(__filename)
|
||||
vi.mocked(dirname).mockReturnValue(__dirname)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue