Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(tests): generated test for each example #1041

Merged
merged 4 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
no jsdom test
  • Loading branch information
jasonkuhrt committed Aug 23, 2024
commit bd1387c55a4fdcc60141e9ea21e4f603214e47df
3 changes: 2 additions & 1 deletion scripts/generate-test-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const files = await readFiles({
})

await Promise.all(files.map(async (file) => {
const code = `import { execaCommand } from 'execa'
const code = `// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'

Expand Down
1 change: 1 addition & 0 deletions tests/examples/arguments.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'
Expand Down
1 change: 1 addition & 0 deletions tests/examples/config-fetch.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'
Expand Down
1 change: 1 addition & 0 deletions tests/examples/config-http-headers.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'
Expand Down
1 change: 1 addition & 0 deletions tests/examples/raw-typed.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'
Expand Down
1 change: 1 addition & 0 deletions tests/examples/raw.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'
Expand Down
1 change: 1 addition & 0 deletions tests/examples/rawString-typed.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'
Expand Down
1 change: 1 addition & 0 deletions tests/examples/rawString.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @vitest-environment node
import { execaCommand } from 'execa'
import stripAnsi from 'strip-ansi'
import { expect, test } from 'vitest'
Expand Down