Namespace more

This commit is contained in:
Manav Rathi 2024-02-10 16:19:06 +05:30
parent 36e76626cd
commit 977da14e70
2 changed files with 5 additions and 6 deletions

View file

@ -76,4 +76,4 @@
# The path of the JSON file which contains the expected results of our
# 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

View file

@ -100,14 +100,13 @@ const FILE_NAME_TO_JSON_NAME = [
];
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(
'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) {
throw Error('upload test failed expectedState missing');
}