Skip to content

Commit 7a4ed2b

Browse files
Fix test and minor inconsistencies
1 parent be90fdd commit 7a4ed2b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@
259259
"start": "tsc --watch --sourceMap --declarationMap",
260260
"prepare": "husky install",
261261
"preversion": "yarn install",
262-
"test": "jest",
262+
"test": "STREAM_CHAT_REACT_VERSION='x.x.x' jest",
263263
"types": "tsc --noEmit --skipLibCheck false",
264264
"validate-translations": "node scripts/validate-translations.js",
265265
"validate-cjs": "concurrently 'node scripts/validate-cjs-node-bundle.cjs' 'node scripts/validate-cjs-browser-bundle.cjs'",
@@ -282,4 +282,4 @@
282282
"not op_mini all"
283283
],
284284
"packageManager": "yarn@1.22.21+sha1.1959a18351b811cdeedbd484a8f86c3cc3bbaf72"
285-
}
285+
}

Diff for: scripts/get-package-version.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { execSync } from 'node:child_process';
22
import packageJson from '../package.json' with { type: 'json' };
33

4-
// get the latest version so that "__STREAM_CHAT_REACT_VERSION__" can be replaced with it in the source code (used for reporting purposes), see bundle-cjs.mjs/bundle-esm.mjs for source
4+
// get the latest version so that "process.env.STREAM_CHAT_REACT_VERSION" can be replaced with it in the source code (used for reporting purposes), see bundle-cjs.mjs/bundle-esm.mjs for source
55
export default function getPackageVersion() {
66
// "build" script ("prepack" hook) gets invoked when semantic-release runs "npm publish", at that point package.json#version already contains updated next version which we can use
77
let version = packageJson.version;

Diff for: src/components/Chat/__tests__/Chat.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ describe('Chat', () => {
6464
expect(context.openMobileNav).toBeInstanceOf(Function);
6565
expect(context.closeMobileNav).toBeInstanceOf(Function);
6666
expect(context.client.getUserAgent()).toBe(
67-
`stream-chat-react-__STREAM_CHAT_REACT_VERSION__-${originalUserAgent}`,
67+
`stream-chat-react-x.x.x-${originalUserAgent}`,
6868
);
6969
});
7070
});

0 commit comments

Comments
 (0)