declapract-typescript-ehmpathy 0.23.6 → 0.23.7
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.
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { stage, Stage } from './src/utils/environment';
|
|
2
|
-
|
|
3
|
-
// set a longer timeout
|
|
4
1
|
// eslint-disable-next-line no-undef
|
|
5
2
|
jest.setTimeout(90000); // since we're calling downstream apis
|
|
6
3
|
|
|
7
4
|
/**
|
|
8
|
-
* sanity check that
|
|
9
|
-
*
|
|
5
|
+
* sanity check that unit tests are only run the 'test' environment
|
|
6
|
+
*
|
|
7
|
+
* usecases
|
|
8
|
+
* - prevent polluting prod state with test data
|
|
9
|
+
* - prevent executing financially impacting mutations
|
|
10
10
|
*/
|
|
11
|
-
if (
|
|
12
|
-
|
|
11
|
+
if (
|
|
12
|
+
process.env.NODE_ENV !== 'test' &&
|
|
13
|
+
process.env.I_KNOW_WHAT_IM_DOING !== 'true'
|
|
14
|
+
)
|
|
15
|
+
throw new Error(`unit-test is not targeting stage 'test'`);
|
package/package.json
CHANGED