Skip to content

Commit

Permalink
tests: add unit tests for scalars module
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkuhrt committed Mar 9, 2021
1 parent 6e395b9 commit 58163b4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration/scalars.test.ts
Expand Up @@ -95,7 +95,7 @@ it('When bundled custom scalars are used the project type checks and generates e
t.json('JsonManually')
t.dateTime('DateTimeManually')
t.field(M1.someJsonField.name, M1.someJsonField)
t.field(M1.someDateTimeField.name, M1.someDateTimeField)
tefield(M1.someDateTimeField.name, M1.someDateTimeField)
},
})
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/scalars.test.ts
@@ -0,0 +1,23 @@
import NexusPrismaScalars, * as NexusPrismaScalarsNS from '../../scalars'
import { assertBuildPresent } from '../__helpers__'

assertBuildPresent()

it('scalars can be accessed via namespace import', () => {
expect(Object.keys(NexusPrismaScalarsNS)).toMatchInlineSnapshot(`
Array [
"DateTime",
"Json",
"default",
]
`)
})

it('scalars can be accessed via a default import', () => {
expect(Object.keys(NexusPrismaScalars)).toMatchInlineSnapshot(`
Array [
"DateTime",
"Json",
]
`)
})

0 comments on commit 58163b4

Please sign in to comment.