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 { describe, it, expect, vi, beforeEach } from 'vitest'
|
||||||
import { consola } from 'consola'
|
import { consola } from 'consola'
|
||||||
|
|
||||||
import newNow from '../commands/prep-now'
|
import newNow from '../scripts/prep-now'
|
||||||
|
|
||||||
// Mock file system operations
|
// Mock file system operations
|
||||||
vi.mock('path', () => ({
|
vi.mock('path', () => ({
|
||||||
|
|
@ -27,7 +27,7 @@ vi.mock('consola', () => ({
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// Mock mdToHTML
|
// Mock mdToHTML
|
||||||
vi.mock('../command/md-to-html', () => ({
|
vi.mock('../scripts/md-to-html', () => ({
|
||||||
mdToHTML: vi.fn(),
|
mdToHTML: vi.fn(),
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
@ -56,7 +56,7 @@ describe('prep-now', () => {
|
||||||
|
|
||||||
it('should create a new now page and clear the original files', async () => {
|
it('should create a new now page and clear the original files', async () => {
|
||||||
// Mock the mdToHTML function
|
// 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>')
|
vi.mocked(mdToHTML).mockResolvedValue('<h1>Test Content</h1>')
|
||||||
|
|
||||||
// Mock file paths
|
// Mock file paths
|
||||||
|
|
@ -73,8 +73,8 @@ describe('prep-now', () => {
|
||||||
.mockReturnValueOnce('# Test Content')
|
.mockReturnValueOnce('# Test Content')
|
||||||
|
|
||||||
// Mock file paths
|
// Mock file paths
|
||||||
const __filename = '/src/commands/prep-now.ts'
|
const __filename = '/src/scripts/prep-now.ts'
|
||||||
const __dirname = '/src/commands'
|
const __dirname = '/src/scripts'
|
||||||
vi.mocked(fileURLToPath).mockReturnValue(__filename)
|
vi.mocked(fileURLToPath).mockReturnValue(__filename)
|
||||||
vi.mocked(dirname).mockReturnValue(__dirname)
|
vi.mocked(dirname).mockReturnValue(__dirname)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue