diff --git a/package-lock.json b/package-lock.json index c58f83b..148e328 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "configcat-node", - "version": "11.0.0", + "version": "11.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "configcat-node", - "version": "11.0.0", + "version": "11.1.0", "license": "MIT", "dependencies": { - "configcat-common": "^9.0.0", + "configcat-common": "^9.1.0", "tslib": "^2.4.1", "tunnel": "0.0.6" }, @@ -2686,9 +2686,9 @@ } }, "node_modules/configcat-common": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/configcat-common/-/configcat-common-9.0.0.tgz", - "integrity": "sha512-kLI7PSkysn7pks/QsESX0lRkvL/vVc6CL2LlIk2XAd2PazPN/FaaOO/3hU4IbGG+kT3dwggDvGbioiMaYW1YHw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/configcat-common/-/configcat-common-9.1.0.tgz", + "integrity": "sha512-jaYyCAdSZ8Su0Jr1Dx9eIzXEb66yN0M6Vc7b6ceGAQZ0RzsWDdcAVyRACOLZTH6Zwfz8Sb0o4O9b6QZl2PvUfw==", "dependencies": { "tslib": "^2.4.1" } @@ -12986,9 +12986,9 @@ } }, "configcat-common": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/configcat-common/-/configcat-common-9.0.0.tgz", - "integrity": "sha512-kLI7PSkysn7pks/QsESX0lRkvL/vVc6CL2LlIk2XAd2PazPN/FaaOO/3hU4IbGG+kT3dwggDvGbioiMaYW1YHw==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/configcat-common/-/configcat-common-9.1.0.tgz", + "integrity": "sha512-jaYyCAdSZ8Su0Jr1Dx9eIzXEb66yN0M6Vc7b6ceGAQZ0RzsWDdcAVyRACOLZTH6Zwfz8Sb0o4O9b6QZl2PvUfw==", "requires": { "tslib": "^2.4.1" } diff --git a/package.json b/package.json index 0901af1..83897cd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "configcat-node", - "version": "11.0.0", + "version": "11.1.0", "description": "Official ConfigCat SDK to help you access your feature flags from a Node.js application.", "main": "lib/client.js", "types": "lib/client.d.ts", @@ -32,7 +32,7 @@ }, "engine-strict": true, "dependencies": { - "configcat-common": "^9.0.0", + "configcat-common": "^9.1.0", "tslib": "^2.4.1", "tunnel": "0.0.6" }, diff --git a/test/special-character-tests.ts b/test/special-character-tests.ts new file mode 100644 index 0000000..18639a6 --- /dev/null +++ b/test/special-character-tests.ts @@ -0,0 +1,31 @@ +import { assert } from "chai"; +import { IConfigCatClient, IOptions, LogLevel, PollingMode, User } from "configcat-common"; +import * as configcatClient from "../src/client"; +import { createConsoleLogger } from "../src/client"; + +const sdkKey = "configcat-sdk-1/PKDVCLf-Hq-h-kCzMp-L7Q/u28_1qNyZ0Wz-ldYHIU7-g"; + +describe("Special characters test", () => { + + const options: IOptions = { logger: createConsoleLogger(LogLevel.Off) }; + + let client: IConfigCatClient; + + beforeEach(function() { + client = configcatClient.getClient(sdkKey, PollingMode.AutoPoll, options); + }); + + afterEach(function() { + client.dispose(); + }); + + it("Special characters works - cleartext", async () => { + const actual: string = await client.getValueAsync("specialCharacters", "NOT_CAT", new User("äöüÄÖÜçéèñışğ⢙✓😀")); + assert.strictEqual(actual, "äöüÄÖÜçéèñışğ⢙✓😀"); + }); + + it("Special characters works - hashed", async () => { + const actual: string = await client.getValueAsync("specialCharactersHashed", "NOT_CAT", new User("äöüÄÖÜçéèñışğ⢙✓😀")); + assert.strictEqual(actual, "äöüÄÖÜçéèñışğ⢙✓😀"); + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 182bcaa..9c51325 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,5 +5,10 @@ "target": "ESNext", "importHelpers": true, "moduleResolution": "Node" - } + }, + "exclude": [ + "**/node_modules/", + "lib/", + "samples/" + ] } \ No newline at end of file