- Edit jest.config.json ['moduleNameMapper'] with your scoped package names
e.g. "^@acme-corp/(.\*)$": "<rootDir>/packages/$1/"
-> "^@my-corp/(.\*)$": "<rootDir>/packages/$1/"
- Remove example packages from
./packages
folder by deleting them
npm run add-package --scope={named-scope} --package_name={package-name}
npm init --scope=@{named-scope} -y
In order to add a submodule change directory to ./package
and run:
git submodule add {url}
Running the npm test
command from projects root directory will run the tests for the all the packages in the workspace.
npm test -w {named-scope/package-name}
https://blog.frankdejonge.nl/setting-up-a-typescript-mono-repo-for-scoped-packages/