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.
@@ -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.NPM_TOKEN }}
30
+ NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token }}
@@ -11,5 +11,6 @@ jobs:
11
11
 
12
12
  publish:
13
13
  uses: ./.github/workflows/.publish-npm.yml
14
+ needs: [test]
14
15
  secrets:
15
16
  npm-auth-token: ${{ secrets.NPM_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 in 'test' environment
9
- * - if they are run in prod environment, we could load a bunch of junk data into our prod databases, which would be no bueno
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 (stage !== Stage.TEST && process.env.I_KNOW_WHAT_IM_DOING !== 'true')
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "declapract-typescript-ehmpathy",
3
- "version": "0.23.3",
3
+ "version": "0.23.6",
4
4
  "description": "declapract best practices declarations for typescript",
5
5
  "main": "src/index.js",
6
6
  "repository": "ehmpathy/declapract-typescript-ehmpathy",
@@ -1,6 +0,0 @@
1
- {
2
- "scripts": {
3
- "fix:format:terraform": "echo 'terraform not used'",
4
- "test:format:terraform": "echo 'terraform not used'"
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { FileCheckType } from 'declapract';
2
-
3
- // TODO: move this check out into the function that defines `fix:format`, and have it check whether it should include terraform instead
4
- export const check = FileCheckType.CONTAINS;