Skip to content

Commit

Permalink
Minor improvements (#70)
Browse files Browse the repository at this point in the history
* Add special character tests

* Exclude non-source files so they don't pollute autocompletion/intellisense

* Update to configcat-common v9.1.0

* Bump version
  • Loading branch information
adams85 authored Jan 9, 2024
1 parent c40dae7 commit c7f5a2c
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 12 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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"
},
Expand Down
31 changes: 31 additions & 0 deletions test/special-character-tests.ts
Original file line number Diff line number Diff line change
@@ -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, "äöüÄÖÜçéèñışğ⢙✓😀");
});
});
7 changes: 6 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
"target": "ESNext",
"importHelpers": true,
"moduleResolution": "Node"
}
},
"exclude": [
"**/node_modules/",
"lib/",
"samples/"
]
}

0 comments on commit c7f5a2c

Please sign in to comment.