add new CWS user parsing method

This commit is contained in:
Michael C
2023-02-20 22:21:53 -05:00
parent 72fb4eb6ec
commit 1bda331b0c
3 changed files with 58 additions and 32 deletions

View File

@@ -2,6 +2,7 @@ import axios from "axios";
import assert from "assert";
import { config } from "../../src/config";
import { getHash } from "../../src/utils/getHash";
import { client } from "../utils/httpClient";
describe("userCounter", () => {
it("Should return 200", function (done) {
@@ -20,4 +21,13 @@ describe("userCounter", () => {
})
.catch(err => done(err));
});
it("Should not incremeent counter on OPTIONS", function (done) {
/* cannot spy test */
if (!config.userCounterURL) this.skip(); // skip if no userCounterURL is set
//const spy = sinon.spy(UserCounter);
client({ method: "OPTIONS", url: "/api/status" })
.then(() => client({ method: "GET", url: "/api/status" }));
//assert.strictEqual(spy.callCount, 1);
done();
});
});