This project is a bug reproduction
To run the tests illustrating the issue here, you will need a local postgresql database.
The following psql
commands can get you started with local credentials and databases:
postgres=# CREATE ROLE example WITH LOGIN PASSWORD '{enter local password here}';
# note: this permission is required to install postgresql extensions (such as "uuid-ossp")
postgres=# ALTER USER example WITH SUPERUSER;
# Create app database (runtime, not needed to run integration tests)
postgres=# CREATE DATABASE "example";
postgres=# GRANT ALL PRIVILEGES ON DATABASE "example" TO example;
postgres=# ALTER DATABASE "example" OWNER TO example;
# Create test database
postgres=# CREATE DATABASE "example-test";
postgres=# GRANT ALL PRIVILEGES ON DATABASE "example-test" TO example;
postgres=# ALTER DATABASE "example-test" OWNER TO example;
You can run the \l
pg command to verify your local setup:
postgres-# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
--------------+---------+----------+---------+-------+---------------------
example | example | UTF8 | C | C | =Tc/example +
| | | | | example=CTc/example
example-test | example | UTF8 | C | C | =Tc/example +
| | | | | example=CTc/example
Finally, install the dependencies:
yarn install
You can check the running "example-app" application if you wish by running
yarn nx run example-app:serve
It seems something change in [email protected]
causing the globalTeardown script to crash (and the tests to fail)
- the master branch illustrate a working scenario using
ts-jest
locked to27.1.2
- a branch named
reproduction/ts-jest-27.1.3
illustrate the bug (only change being the update from27.1.2
to27.1.3
)
Run on master branch and notice the successful tests
git checkout master
yarn install
yarn run test:all
NX Successfully ran target test for 3 projects
Then checkout the branch and notice an error:
git checkout reproduction/ts-jest-27.1.3
yarn install
yarn run test:all
[TSError: apps/example-app-integration/jest/globalTeardown.ts:5:13 - error TS2695: Left side of comma operator is unused and has no side effects.
5 return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {