Skip to content

Commit

Permalink
chore: fix test formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed Jul 21, 2019
1 parent 70c611e commit a9ae9bf
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions packages/typegen/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,27 @@ describe('type generator', () => {
const foo = await slonik.one(sql.FooBar`select * from foo`)
expectType<{abc: string}>(foo)
expect(foo).toMatchInlineSnapshot(`
Object {
"a": "xyz",
"b": null,
"c": null,
"d": null,
"e": null,
"id": 1,
}
`)
Object {
"a": "xyz",
"b": null,
"c": null,
"d": null,
"e": null,
"id": 1,
}
`)
})

it('does not add interceptors when write types is falsy', () => {
const {sql, poolConfig} = setupTypeGen({knownTypes})
expect(typeof sql).toEqual('function')
expect(typeof sql.FooBarBaz).toEqual('function')
expect(poolConfig).toMatchInlineSnapshot(`
Object {
"interceptors": Array [],
"typeParsers": Array [],
}
`)
Object {
"interceptors": Array [],
"typeParsers": Array [],
}
`)
})

it('adds type parsers when write types is falsy', () => {
Expand All @@ -116,16 +116,16 @@ describe('type generator', () => {
expect(typeof sql).toEqual('function')
expect(typeof sql.FooBarBaz).toEqual('function')
expect(poolConfig).toMatchInlineSnapshot(`
Object {
"interceptors": Array [],
"typeParsers": Array [
Object {
"name": "timestamptz",
"parse": [Function],
},
],
}
`)
Object {
"interceptors": Array [],
"typeParsers": Array [
Object {
"name": "timestamptz",
"parse": [Function],
},
],
}
`)
})

it('can create generated types directory', async () => {
Expand Down Expand Up @@ -212,10 +212,10 @@ describe('type generator', () => {
const result = await slonikWithDirectionMapper.one(sql.Bar`select * from bar`)
expectType<'up' | 'down'>(result.dir)
expect(result).toMatchInlineSnapshot(`
Object {
"dir": "up",
}
`)
Object {
"dir": "up",
}
`)
})

it(`doesn't break in-built helper functions`, () => {
Expand Down

0 comments on commit a9ae9bf

Please sign in to comment.