Skip to content

Commit 7865145

Browse files
committed
Fixed version fallback logic
1 parent 0340ca6 commit 7865145

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,4 +1013,4 @@ export const fft = {
10131013

10141014
declare const __VERSION_PLACEHOLDER__: string;
10151015
export const __version__ =
1016-
typeof __VERSION_PLACEHOLDER__ !== 'undefined' ? __VERSION_PLACEHOLDER__ : '1.2.0';
1016+
typeof __VERSION_PLACEHOLDER__ !== 'undefined' ? __VERSION_PLACEHOLDER__ : 'dev';

tests/bundles/node.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ describe('Node.js ESM Bundle Smoke Test', () => {
3434
expect(np.arange).toBeDefined();
3535
});
3636

37+
test('should expose a real version (build-time injected, not "dev")', () => {
38+
expect(typeof np.__version__).toBe('string');
39+
expect(np.__version__).not.toBe('dev');
40+
expect(np.__version__).toMatch(/^\d+\.\d+\.\d+/);
41+
});
42+
3743
test('should create arrays', () => {
3844
const arr = np.array([1, 2, 3, 4]);
3945
expect(arr.shape).toEqual([4]);

0 commit comments

Comments
 (0)