declapract-typescript-ehmpathy 0.23.3 → 0.23.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/practices/cicd-common/best-practice/.github/workflows/.test.yml +2 -2
- package/dist/practices/cicd-package/best-practice/.github/workflows/.publish-npm.yml +2 -1
- package/dist/practices/cicd-package/best-practice/.github/workflows/publish.yml +1 -0
- package/dist/practices/testing/best-practice/jest.unit.env.ts +9 -5
- package/dist/practices/testing/best-practice/jest.unit.env.ts.declapract.ts +1 -2
- package/package.json +1 -1
- package/dist/practices/cicd-package/best-practice/package.json +0 -6
- package/dist/practices/cicd-package/best-practice/package.json.declapract.ts +0 -4
|
@@ -190,7 +190,7 @@ jobs:
|
|
|
190
190
|
|| echo 'correct aws account';
|
|
191
191
|
|
|
192
192
|
- name: provision:integration-test-db
|
|
193
|
-
run: npm run provision:integration-test-db
|
|
193
|
+
run: npm run provision:integration-test-db --if-present
|
|
194
194
|
|
|
195
195
|
- name: test:integration
|
|
196
196
|
run: npm run test:integration
|
|
@@ -231,7 +231,7 @@ jobs:
|
|
|
231
231
|
|| echo 'correct aws account';
|
|
232
232
|
|
|
233
233
|
- name: provision:integration-test-db
|
|
234
|
-
run: npm run provision:integration-test-db
|
|
234
|
+
run: npm run provision:integration-test-db --if-present
|
|
235
235
|
|
|
236
236
|
- name: test:acceptance:locally
|
|
237
237
|
run: npm run test:acceptance:locally
|
|
@@ -17,6 +17,7 @@ jobs:
|
|
|
17
17
|
- name: set node version
|
|
18
18
|
uses: actions/setup-node@v3
|
|
19
19
|
with:
|
|
20
|
+
registry-url: 'https://registry.npmjs.org/'
|
|
20
21
|
node-version-file: '.nvmrc'
|
|
21
22
|
cache: 'npm'
|
|
22
23
|
|
|
@@ -26,4 +27,4 @@ jobs:
|
|
|
26
27
|
- name: publish
|
|
27
28
|
run: npm publish
|
|
28
29
|
env:
|
|
29
|
-
NODE_AUTH_TOKEN: ${{ secrets.
|
|
30
|
+
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token }}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { stage, Stage } from './src/utils/environment';
|
|
2
|
-
|
|
3
1
|
jest.mock('./src/utils/config/getConfig', () => ({
|
|
4
2
|
getConfig: jest.fn().mockImplementation(() => require('./config/test.json')), // mock that getConfig just returns plaintext test env config in unit tests
|
|
5
3
|
}));
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
|
-
* sanity check that unit tests are only run
|
|
9
|
-
*
|
|
6
|
+
* sanity check that unit tests are only run the 'test' environment
|
|
7
|
+
*
|
|
8
|
+
* usecases
|
|
9
|
+
* - prevent polluting prod state with test data
|
|
10
|
+
* - prevent executing financially impacting mutations
|
|
10
11
|
*/
|
|
11
|
-
if (
|
|
12
|
+
if (
|
|
13
|
+
process.env.NODE_ENV !== 'test' &&
|
|
14
|
+
process.env.I_KNOW_WHAT_IM_DOING !== 'true'
|
|
15
|
+
)
|
|
12
16
|
throw new Error(`unit-test is not targeting stage 'test'`);
|
|
@@ -15,8 +15,7 @@ export const contents: FileContentsFunction = async (context) => {
|
|
|
15
15
|
let contents = contentsSuperset;
|
|
16
16
|
if (!context.projectPractices.includes('config'))
|
|
17
17
|
contents = contents.replace(
|
|
18
|
-
`
|
|
19
|
-
jest.mock('./src/utils/config/getConfig', () => ({
|
|
18
|
+
`jest.mock('./src/utils/config/getConfig', () => ({
|
|
20
19
|
getConfig: jest.fn().mockImplementation(() => require('./config/test.json')), // mock that getConfig just returns plaintext test env config in unit tests
|
|
21
20
|
}));
|
|
22
21
|
`,
|
package/package.json
CHANGED