Skip to content

Commit 04db3a9

Browse files
authored
test: move unit tests next to files (NASA-AMMOS#45)
- Also reorg e2e test folder
1 parent fbd7355 commit 04db3a9

22 files changed

+8
-8
lines changed
File renamed without changes.
File renamed without changes.

tests/e2e/fixtures/Dictionaries.ts e2e-tests/fixtures/Dictionaries.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class Dictionaries {
2121
this.page = page;
2222

2323
this.dictionaryName = uniqueNamesGenerator({ dictionaries: [colors, animals] });
24-
this.dictionaryPath = 'tests/e2e/data/command-dictionary.xml';
24+
this.dictionaryPath = 'e2e-tests/data/command-dictionary.xml';
2525

2626
const dictionaryFile = readFileSync(this.dictionaryPath);
2727
const dictionaryXml = dictionaryFile.toString().replace(/GENERIC/, this.dictionaryName);
File renamed without changes.
File renamed without changes.

tests/e2e/fixtures/Models.ts e2e-tests/fixtures/Models.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export class Models {
2323
this.page = page;
2424

2525
// TODO: Pull .jar file directly from built aerie project.
26-
this.jarPath = 'tests/e2e/data/banananation-develop.jar';
26+
this.jarPath = 'e2e-tests/data/banananation-develop.jar';
2727
this.modelName = uniqueNamesGenerator({ dictionaries: [colors, animals] });
2828
this.modelVersion = '1.0.0';
2929

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

playwright.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const config: PlaywrightTestConfig = {
99
['junit', { outputFile: 'e2e-test-results/junit-results.xml' }],
1010
],
1111
retries: 0,
12-
testDir: './tests/e2e',
12+
testDir: './e2e-tests',
1313
use: {
1414
baseURL: 'http://localhost:3000',
1515
browserName: 'chromium',

tests/unit/time.test.ts src/utilities/time.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect, test } from 'vitest';
2-
import { getDoy } from '../../src/utilities/time';
2+
import { getDoy } from './time';
33

44
test('getDoy', () => {
55
const doy = getDoy(new Date('1/3/2019'));

svelte.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const config = {
88
vite: {
99
test: {
1010
environment: 'jsdom',
11-
include: ['./tests/unit/**/*.test.ts'],
12-
outputFile: 'unit-test-results/json-results.json',
13-
reporters: 'json',
11+
include: ['./src/**/*.test.ts'],
12+
outputFile: process.env.CI ? 'unit-test-results/json-results.json' : null,
13+
reporters: process.env.CI ? 'json' : null,
1414
},
1515
},
1616
},

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"target": "es2020"
1717
},
1818
"extends": "./.svelte-kit/tsconfig.json",
19-
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte", "tests/unit/**/*.test.ts"]
19+
"include": ["src/**/*.d.ts", "src/**/*.js", "src/**/*.ts", "src/**/*.svelte"]
2020
}

0 commit comments

Comments
 (0)