Skip to content

Commit

Permalink
Upgrade prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomWright committed Apr 6, 2020
1 parent 1100d0b commit bfdd2a3
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 111 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"ava": "^3.6.0",
"fit-commit-js": "^0.3.2",
"husky": "^3.1.0",
"prettier": "^1.19.1",
"prettier": "^2.0.4",
"sinon": "^7.5.0",
"ts-node": "^8.8.2",
"tslint": "^6.1.1",
Expand Down
36 changes: 18 additions & 18 deletions src/__tests__/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const CONTAINER_NAME = "pg-migrations-test-create"

let port: number

test.before.cb(t => {
test.before.cb((t) => {
port = startPostgres(CONTAINER_NAME, t)
})

test.after.always(() => {
stopPostgres(CONTAINER_NAME)
})

test("with connected client", async t => {
test("with connected client", async (t) => {
t.plan(0)

const client = new pg.Client({
Expand All @@ -35,7 +35,7 @@ test("with connected client", async t => {
}
})

test("successful creation", t => {
test("successful creation", (t) => {
t.plan(0)

return createDb("create-test-success", {
Expand All @@ -46,7 +46,7 @@ test("successful creation", t => {
})
})

test("bad arguments - no database name", t => {
test("bad arguments - no database name", (t) => {
return t
.throwsAsync(
// tslint:disable-next-line no-any
Expand All @@ -57,23 +57,23 @@ test("bad arguments - no database name", t => {
port,
}),
)
.then(err => {
.then((err) => {
t.regex(err.message, /database name/)
})
})

test("bad arguments - empty db config", t => {
test("bad arguments - empty db config", (t) => {
return (
t
// tslint:disable-next-line no-any
.throwsAsync(createDb("create-test-no-config", {} as any))
.then(err => {
.then((err) => {
t.regex(err.message, /config/)
})
)
})

test("bad arguments - incorrect user", t => {
test("bad arguments - incorrect user", (t) => {
return t
.throwsAsync(
createDb("create-test-user", {
Expand All @@ -83,12 +83,12 @@ test("bad arguments - incorrect user", t => {
port,
}),
)
.then(err => {
.then((err) => {
t.regex(err.message, /nobody/)
})
})

test("bad arguments - incorrect password", t => {
test("bad arguments - incorrect password", (t) => {
return t
.throwsAsync(
createDb("create-test-password", {
Expand All @@ -98,12 +98,12 @@ test("bad arguments - incorrect password", t => {
port,
}),
)
.then(err => {
.then((err) => {
t.regex(err.message, /password/)
})
})

test("bad arguments - incorrect host", t => {
test("bad arguments - incorrect host", (t) => {
return t
.throwsAsync(
createDb("create-test-host", {
Expand All @@ -113,12 +113,12 @@ test("bad arguments - incorrect host", t => {
port,
}),
)
.then(err => {
.then((err) => {
t.regex(err.message, /sillyhost/)
})
})

test("bad arguments - incorrect port", t => {
test("bad arguments - incorrect port", (t) => {
return t
.throwsAsync(
createDb("create-test-port", {
Expand All @@ -128,12 +128,12 @@ test("bad arguments - incorrect port", t => {
port: 1234,
}),
)
.then(err => {
.then((err) => {
t.regex(err.message, /1234/)
})
})

test("already created", t => {
test("already created", (t) => {
t.plan(0)
const create = () =>
createDb("create-test-duplicate", {
Expand All @@ -146,7 +146,7 @@ test("already created", t => {
return create().then(create)
})

test("database name included in config", t => {
test("database name included in config", (t) => {
t.plan(0)
const create = () =>
createDb("create-test-db-name", {
Expand All @@ -161,7 +161,7 @@ test("database name included in config", t => {
return create().then(create)
})

test("custom default database name", t => {
test("custom default database name", (t) => {
t.plan(0)
const create = () =>
createDb("create-test-default-db", {
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/fixtures/docker-postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const startPostgres = (containerName: string, t: CbExecutionContext) => {
"--filter",
"event=health_status",
])
events.stdout.on("data", data => {
events.stdout.on("data", (data) => {
const dataString = data.toString()

if (dataString.includes("health_status: healthy")) {
Expand All @@ -42,7 +42,7 @@ export const startPostgres = (containerName: string, t: CbExecutionContext) => {
t.end()
}
})
events.on("error", err => {
events.on("error", (err) => {
console.error("Error in 'docker events' process:", err)
events.kill()
t.fail(err.message)
Expand Down
Loading

0 comments on commit bfdd2a3

Please sign in to comment.