Skip to content

Commit

Permalink
Fix mistake in test (#82)
Browse files Browse the repository at this point in the history
Signed-off-by: Levko Kravets <[email protected]>

Signed-off-by: Levko Kravets <[email protected]>
  • Loading branch information
kravets-levko authored Oct 26, 2022
1 parent abb0d73 commit f609014
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/unit/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ describe('buildUserAgentString', () => {
// Prefix: 'NodejsDatabricksSqlConnector/'
// Version: three period-separated digits and optional suffix
const re =
/^(?<productName>NodejsDatabricksSqlConnector)\/(?<productVersion>\d+\.\d+\.\d+(-[^(]+)?)\((?<comment>[^)]+)\)$/i;
/^(?<productName>NodejsDatabricksSqlConnector)\/(?<productVersion>\d+\.\d+\.\d+(-[^(]+)?)\s*\((?<comment>[^)]+)\)$/i;
const match = re.exec(ua);
expect(match).to.not.be.eq(null);

const { comment } = match.groups;

expect(comment.split(';').length).to.be.gte(2); // at least Node ans OS version should be there
expect(comment.split(';').length).to.be.gte(2); // at least Node and OS version should be there

if (clientId) {
expect(comment.trim()).to.satisfy((s) => s.startsWith(`${clientId};`));
Expand Down

0 comments on commit f609014

Please sign in to comment.