Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hanspagel committed Dec 11, 2023
1 parent a84d3bf commit 6532039
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
16 changes: 9 additions & 7 deletions packages/snippetz/src/format.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, describe } from 'vitest'
import { expect, describe, it } from 'vitest'
import { format } from './format'

const tree = {
Expand All @@ -25,10 +25,12 @@ const tree = {
}

describe('format', async () => {
expect(
await format({
target: 'js',
tree,
})
).toBe(`const answer = 42\n`)
it('formats basic JS', async () => {
expect(
await format({
target: 'js',
tree,
})
).toBe(`const answer = 42\n`)
})
})
16 changes: 9 additions & 7 deletions packages/snippetz/src/print.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, describe } from 'vitest'
import { expect, describe, it } from 'vitest'
import { print } from './print'

const tree = {
Expand All @@ -25,10 +25,12 @@ const tree = {
}

describe('print', async () => {
expect(
await print({
target: 'js',
tree,
})
).toBe(`const answer = 42;\n`)
it('prints basic JS', async () => {
expect(
print({
target: 'js',
tree,
})
).toBe(`const answer = 42;\n`)
})
})
14 changes: 8 additions & 6 deletions packages/snippetz/src/snippetz.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, describe } from 'vitest'
import { expect, describe, it } from 'vitest'
import { snippetz } from './snippetz'

const tree = {
Expand All @@ -25,10 +25,12 @@ const tree = {
}

describe('snippetz', async () => {
const snippet = await snippetz().get({
target: 'js',
tree,
})
it('formats basic JS', async () => {
const snippet = await snippetz().get({
target: 'js',
tree,
})

expect(snippet).toBe(`const answer = 42\n`)
expect(snippet).toBe(`const answer = 42\n`)
})
})

0 comments on commit 6532039

Please sign in to comment.