Skip to content

Commit 3110cb4

Browse files
committed
test(getos): add test to check consistent parsing
1 parent 66541de commit 3110cb4

File tree

1 file changed

+15
-0
lines changed
  • packages/mongodb-memory-server-core/src/util/getos/__tests__

1 file changed

+15
-0
lines changed

packages/mongodb-memory-server-core/src/util/getos/__tests__/getos.test.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ DISTRIB_DESCRIPTION="Linux Mint 20.1 Ulyssa"`;
2828
codename: 'ulyssa',
2929
});
3030
});
31+
32+
it('should parse to UNKNOWN for different formats', () => {
33+
// output taken from "elementary/docker:fe08f970723a" at "/etc/upstream-release/lsb-release"
34+
const example = `ID=Ubuntu
35+
VERSION_ID=20.04
36+
VERSION_CODENAME=focal
37+
PRETTY_NAME="Ubuntu 20.04.5 LTS"`;
38+
39+
expect(getos.parseLSB(example)).toEqual<getos.LinuxOS>({
40+
os: 'linux',
41+
dist: getos.UNKNOWN,
42+
release: '',
43+
codename: undefined,
44+
});
45+
});
3146
});
3247

3348
describe('parseOS', () => {

0 commit comments

Comments
 (0)