Skip to content

Commit c7f5a2c

Browse files
authored
Minor improvements (#70)
* Add special character tests * Exclude non-source files so they don't pollute autocompletion/intellisense * Update to configcat-common v9.1.0 * Bump version
1 parent c40dae7 commit c7f5a2c

File tree

4 files changed

+48
-12
lines changed

4 files changed

+48
-12
lines changed

Diff for: package-lock.json

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "configcat-node",
3-
"version": "11.0.0",
3+
"version": "11.1.0",
44
"description": "Official ConfigCat SDK to help you access your feature flags from a Node.js application.",
55
"main": "lib/client.js",
66
"types": "lib/client.d.ts",
@@ -32,7 +32,7 @@
3232
},
3333
"engine-strict": true,
3434
"dependencies": {
35-
"configcat-common": "^9.0.0",
35+
"configcat-common": "^9.1.0",
3636
"tslib": "^2.4.1",
3737
"tunnel": "0.0.6"
3838
},

Diff for: test/special-character-tests.ts

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { assert } from "chai";
2+
import { IConfigCatClient, IOptions, LogLevel, PollingMode, User } from "configcat-common";
3+
import * as configcatClient from "../src/client";
4+
import { createConsoleLogger } from "../src/client";
5+
6+
const sdkKey = "configcat-sdk-1/PKDVCLf-Hq-h-kCzMp-L7Q/u28_1qNyZ0Wz-ldYHIU7-g";
7+
8+
describe("Special characters test", () => {
9+
10+
const options: IOptions = { logger: createConsoleLogger(LogLevel.Off) };
11+
12+
let client: IConfigCatClient;
13+
14+
beforeEach(function() {
15+
client = configcatClient.getClient(sdkKey, PollingMode.AutoPoll, options);
16+
});
17+
18+
afterEach(function() {
19+
client.dispose();
20+
});
21+
22+
it("Special characters works - cleartext", async () => {
23+
const actual: string = await client.getValueAsync("specialCharacters", "NOT_CAT", new User("äöüÄÖÜçéèñışğ⢙✓😀"));
24+
assert.strictEqual(actual, "äöüÄÖÜçéèñışğ⢙✓😀");
25+
});
26+
27+
it("Special characters works - hashed", async () => {
28+
const actual: string = await client.getValueAsync("specialCharactersHashed", "NOT_CAT", new User("äöüÄÖÜçéèñışğ⢙✓😀"));
29+
assert.strictEqual(actual, "äöüÄÖÜçéèñışğ⢙✓😀");
30+
});
31+
});

Diff for: tsconfig.json

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,10 @@
55
"target": "ESNext",
66
"importHelpers": true,
77
"moduleResolution": "Node"
8-
}
8+
},
9+
"exclude": [
10+
"**/node_modules/",
11+
"lib/",
12+
"samples/"
13+
]
914
}

0 commit comments

Comments
 (0)