typeorm / typeorm

ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
http://typeorm.io
MIT License
33.54k stars 6.22k forks source link

refactor: tidied existing mocha test scripts in package.json and added a test-ts script #10864

Open RohanTalip opened 1 month ago

RohanTalip commented 1 month ago

Description of change

mocha allows for configurations to be put into files. See https://github.com/mochajs/mocha/tree/master/example/config and https://mochajs.org/#configuring-mocha-nodejs .

This allows the test and test-fast scripts in the package.json file to be more concise.

I find YAML to be more concise for mocha configuration files than JSON files, but also allow for comments. I added a .mocharc-compiled.yaml file for the test and test-fast scripts, and I also added a .mocharc.yaml file for a new test-ts script that uses ts-node (to run the tests without needing to compile/transpile them first), and which will also be used by default when running npx mocha path/to/test.ts.

Most tests are passing locally when run via test-ts path/to/test.ts or npx mocha path/to/test.ts. I fixed some imports/requires in some tests but there are still a few that are failing locally, on my Mac.

Pull-Request Checklist