Skip to content

Commit e0f8103

Browse files
committed
Make sure to build the nitro-app before tests
1 parent 675c34f commit e0f8103

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/env/nitro-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"scripts": {
4-
"test": "jest",
4+
"test": "yarn build && jest",
55
"dev": "npx nitropack dev",
66
"build": "npx nitropack build",
77
"preview": "node .output/server/index.mjs"
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
const { execSync, spawn } = require('child_process')
1+
const { spawn } = require('child_process')
22

33
let server
44

55
beforeAll(() => {
6-
execSync('yarn', ['build'], { env: process.env })
7-
86
server = spawn('node', ['.output/server/index.mjs'])
97
})
108

9+
afterAll(() => {
10+
server.kill()
11+
})
12+
1113
describe('Meilisearch JS w/ Nitro App Server Browser test', () => {
1214
it('Should have created an index and displayed it', async () => {
1315
await new Promise((next) => {
@@ -21,8 +23,4 @@ describe('Meilisearch JS w/ Nitro App Server Browser test', () => {
2123

2224
expect(data.health).toBe(true)
2325
})
24-
25-
afterAll(() => {
26-
server.kill()
27-
})
2826
})

0 commit comments

Comments
 (0)