浏览代码

Namespace more

Manav Rathi 1 年之前
父节点
当前提交
977da14e70
共有 2 个文件被更改,包括 5 次插入6 次删除
  1. 1 1
      apps/photos/.env.development
  2. 4 5
      apps/photos/tests/upload.test.ts

+ 1 - 1
apps/photos/.env.development

@@ -76,4 +76,4 @@
 
 
 # The path of the JSON file which contains the expected results of our
 # The path of the JSON file which contains the expected results of our
 # integration tests. See `upload.test.ts` for more details.
 # integration tests. See `upload.test.ts` for more details.
-# NEXT_PUBLIC_EXPECTED_JSON_PATH = /path/to/dataset/expected.json
+# NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON_PATH = /path/to/dataset/expected.json

+ 4 - 5
apps/photos/tests/upload.test.ts

@@ -100,14 +100,13 @@ const FILE_NAME_TO_JSON_NAME = [
 ];
 ];
 
 
 export async function testUpload() {
 export async function testUpload() {
-    if (!process.env.NEXT_PUBLIC_EXPECTED_JSON_PATH) {
+    const jsonPath = process.env.NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON_PATH;
+    if (!jsonPath) {
         throw Error(
         throw Error(
-            'upload test failed NEXT_PUBLIC_EXPECTED_JSON_PATH missing'
+            'Please specify the NEXT_PUBLIC_ENTE_TEST_EXPECTED_JSON_PATH to run the upload tests'
         );
         );
     }
     }
-    const expectedState = await import(
-        process.env.NEXT_PUBLIC_EXPECTED_JSON_PATH
-    );
+    const expectedState = await import(jsonPath);
     if (!expectedState) {
     if (!expectedState) {
         throw Error('upload test failed expectedState missing');
         throw Error('upload test failed expectedState missing');
     }
     }