Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danez committed Jan 16, 2023
1 parent ad1dc81 commit 6615859
Show file tree
Hide file tree
Showing 49 changed files with 24 additions and 32 deletions.
6 changes: 3 additions & 3 deletions packages/framework-info/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ src/generated
.netlify

# These are mock node_modules folder for testing purposes
!test/fixtures/simple/node_modules
!test/fixtures/multiple/node_modules
!test/fixtures/monorepos/node_modules
!tests/fixtures/simple/node_modules
!tests/fixtures/multiple/node_modules
!tests/fixtures/monorepos/node_modules
29 changes: 0 additions & 29 deletions packages/framework-info/test/options.test.ts

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions packages/framework-info/tests/options.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import process from 'process'

import { expect, test, vi } from 'vitest'

import { listFrameworks } from '../src/main.js'

import { FIXTURES_DIR } from './helpers/main.js'

test('projectDir option defaults to process.cwd()', async () => {
const spyInstance = vi.spyOn(process, 'cwd').mockReturnValue(`${FIXTURES_DIR}/simple`)
const frameworks = await listFrameworks({})
expect(frameworks).toHaveLength(1)
spyInstance.mockRestore()
})

test('Can trigger with no options', async () => {
const spyInstance = vi.spyOn(process, 'cwd').mockReturnValue(`${FIXTURES_DIR}/simple`)
const frameworks = await listFrameworks()
expect(frameworks).toHaveLength(1)
spyInstance.mockRestore()
})

0 comments on commit 6615859

Please sign in to comment.