Skip to content

Commit

Permalink
Update guide and code for v10 of testcontainers-node (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianrgreco authored Aug 3, 2023
1 parent 1fad468 commit 1682d06
Show file tree
Hide file tree
Showing 4 changed files with 121 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ Initialize a new Node.js project using the `npm init` command:
npm init -y
----

Add `pg`, `jest` and `testcontainers` as dependencies:
Add `pg`, `jest` and `@testcontainers/postgresql` as dependencies:

[source,bash]
----
npm install pg --save
npm install jest testcontainers --save-dev
npm install jest @testcontainers/postgresql --save-dev
----

== Write the tests and solution
Expand Down
194 changes: 116 additions & 78 deletions src/package-lock.json

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

4 changes: 2 additions & 2 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"pg": "^8.11.0"
},
"devDependencies": {
"jest": "^29.5.0",
"testcontainers": "^9.8.0"
"@testcontainers/postgresql": "^10.0.1",
"jest": "^29.5.0"
}
}
2 changes: 1 addition & 1 deletion src/src/customer-repository.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Client } = require("pg");
const { PostgreSqlContainer } = require("testcontainers");
const { PostgreSqlContainer } = require("@testcontainers/postgresql");
const { createCustomerTable, createCustomer, getCustomers } = require("./customer-repository");

describe("Customer Repository", () => {
Expand Down

0 comments on commit 1682d06

Please sign in to comment.