Skip to content

Commit

Permalink
🚧 getting our action going
Browse files Browse the repository at this point in the history
  • Loading branch information
acidjazz committed Aug 21, 2024
1 parent c10f230 commit 466057b
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Empty file added .github/workflows/test.yml
Empty file.
2 changes: 2 additions & 0 deletions app/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
const colorMode = useColorMode()
const color = computed(() => colorMode.value === 'dark' ? '#111827' : 'white')
console.log('we are in app.vue')
useHead({
meta: [
{ charset: 'utf-8' },
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preview": "nuxt preview",
"test": "vitest run",
"test:dev": "DEVRUN=true vitest run",
"test:reset": "pnpm run test:db-reset; vitest run",
"test:reset": "pnpm run db:test:reset; vitest run",
"db:test:reset": "dotenv -e .env.test -- npx prisma migrate reset --force",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
Expand Down
2 changes: 1 addition & 1 deletion server/api/[...slug].ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const router = createRouter()
router.get('/me', authedHandler(async ({ user }) => metapi().render(user)))
router.get('/**', defineEventHandler(event => metapi().notFound(event)))

console.log('appEnv', useRuntimeConfig().appEnv)
console.log('WE ARE SETTING UP ROUTES appEnv', useRuntimeConfig().appEnv)
if (useRuntimeConfig().appEnv === 'test')
router.post('/test/session', test.create)

Expand Down
5 changes: 3 additions & 2 deletions test/user.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ beforeAll(async () => {

async function setupDev() {
if (process.env.DEVRUN === 'true')
setup({ host: 'http://localhost:3000' })
await setup({ host: 'http://localhost:3000' })

else
setup()
await setup({ server: true })
}

async function setupUsers() {
Expand Down
4 changes: 1 addition & 3 deletions vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ export default defineVitestConfig({
environmentOptions: {
nuxt: {
override: {
runtimeConfig: {
appEnv: 'test',
},
dotenv: '.env.test',
},
},
},
Expand Down

0 comments on commit 466057b

Please sign in to comment.