Skip to content

Commit f8ff413

Browse files
make LIB_VERSION dynamic based on package.json value (FF-1998) (#58)
1 parent 863a24a commit f8ff413

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

src/version.spec.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { LIB_VERSION } from './version';
2+
3+
describe('Version Module', () => {
4+
it('should export a LIB_VERSION constant', () => {
5+
expect(LIB_VERSION).toBeDefined();
6+
});
7+
8+
it('should match the version specified in package.json', () => {
9+
// eslint-disable-next-line @typescript-eslint/no-var-requires
10+
const packageJson = require('../package.json');
11+
expect(LIB_VERSION).toBe(packageJson.version);
12+
});
13+
});

src/version.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const LIB_VERSION = '3.0.0';
1+
// eslint-disable-next-line @typescript-eslint/no-var-requires
2+
const packageJson = require('../package.json');
3+
export const LIB_VERSION = packageJson.version;

0 commit comments

Comments
 (0)