Skip to content

Commit 6a33a4a

Browse files
committed
rename test input file
Signed-off-by: Jens Reinecke <[email protected]>
1 parent c0d0bd0 commit 6a33a4a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/cbuild-run/cbuild-run-reader.test.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import { CbuildRunReader } from './cbuild-run-reader';
1818

19-
const TEST_CBUILD_RUN_FILE = 'test-data/multi-core.cbuild-run.yml'; // Relative to repo root
19+
const TEST_CBUILD_RUN_FILE = 'test-data/simple.cbuild-run.yml'; // Relative to repo root
2020
const TEST_FILE_PATH = 'test-data/fileReaderTest.txt'; // Relative to repo root
2121

2222
describe('CbuildRunReader', () => {
@@ -31,19 +31,25 @@ describe('CbuildRunReader', () => {
3131
expect(contents).toMatchSnapshot();
3232
});
3333

34-
it('throws if it parses something other than a *.cbuild-run.yml file', async () => {
34+
it('throws if it parses something other than a *.cbuild-run.yml file and correctly responds to raw contents calls', async () => {
3535
const expectedError = /Invalid '\*\.cbuild-run\.yml' file: .*test-data\/fileReaderTest\.txt/;
3636
const cbuildRunReader = new CbuildRunReader();
3737
await expect(cbuildRunReader.parse(TEST_FILE_PATH)).rejects.toThrow(expectedError);
3838
expect(cbuildRunReader.hasContents()).toBe(false);
3939
expect(cbuildRunReader.getContents()).toBeUndefined();
4040
});
41+
42+
it('correctly responds to raw contents calls if nothing is parsed', () => {
43+
const cbuildRunReader = new CbuildRunReader();
44+
expect(cbuildRunReader.hasContents()).toBe(false);
45+
expect(cbuildRunReader.getContents()).toBeUndefined();
46+
});
4147
});
4248

4349
describe('Extract Values', () => {
4450
let cbuildRunReader: CbuildRunReader;
4551

46-
beforeAll(async () => {
52+
beforeEach(() => {
4753
cbuildRunReader = new CbuildRunReader();
4854
});
4955

@@ -54,5 +60,9 @@ describe('CbuildRunReader', () => {
5460
expect(svdFilePaths).toEqual(expectedSvdFilePaths);
5561
});
5662

63+
it('returns empty SVD file path list if nothing is parsed', () => {
64+
const svdFilePaths = cbuildRunReader.getSvdFilePaths('/my/pack/root');
65+
expect(svdFilePaths.length).toEqual(0);
66+
});
5767
});
5868
});
File renamed without changes.

0 commit comments

Comments
 (0)