Skip to content

Commit

Permalink
replaced chai.expect with assert
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakprabhakara committed Jan 3, 2024
1 parent ac462d5 commit 4c809de
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 108 deletions.
95 changes: 0 additions & 95 deletions package-lock.json

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

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
"@types/node": "20.10.5",
"@typescript-eslint/eslint-plugin": "6.16.0",
"@typescript-eslint/parser": "6.16.0",
"chai": "5.0.0",
"chai-as-promised": "7.1.1",
"eslint": "8.56.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.29.1",
Expand Down
22 changes: 11 additions & 11 deletions src/test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { suite, test } from "@testdeck/mocha";
import { expect } from "chai";
import * as url from "url";

import * as Retraced from "./";
import assert = require("assert");

@suite
class RetracedJSTests {

Check warning on line 8 in src/test.ts

View workflow job for this annotation

GitHub Actions / ci (20)

'RetracedJSTests' is defined but never used

Check warning on line 8 in src/test.ts

View workflow job for this annotation

GitHub Actions / ci (20)

'RetracedJSTests' is defined but never used

Check warning on line 8 in src/test.ts

View workflow job for this annotation

GitHub Actions / publish (18.x)

'RetracedJSTests' is defined but never used
Expand All @@ -13,7 +13,7 @@ class RetracedJSTests {
});

// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(garbo).to.exist;
assert(garbo);
}

@test public "should fail the hash check"() {
Expand Down Expand Up @@ -44,7 +44,7 @@ class RetracedJSTests {
}

// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(explosion).to.exist;
assert(explosion);
}

@test public "should pass the hash check"() {
Expand Down Expand Up @@ -83,7 +83,7 @@ class RetracedJSTests {
}

// eslint-disable-next-line @typescript-eslint/no-unused-expressions
expect(explosion).to.not.exist;
assert.strictEqual(explosion, undefined);
}

@test public "should generate a hash target without a group specified"() {
Expand Down Expand Up @@ -111,7 +111,7 @@ class RetracedJSTests {

const expected =
"kfbr392:even.more.of.a.test:some_object01234:[email protected]:::1:0:abc%3Dxyz=nothing special;";
expect(Retraced.buildHashTarget(testEvent, fakeNew.id)).to.equal(expected);
assert.strictEqual(Retraced.buildHashTarget(testEvent, fakeNew.id), expected);
}

@test
Expand Down Expand Up @@ -214,7 +214,7 @@ class RetracedJSTests {
}
}`;

expect(output).to.equal(answer);
assert.strictEqual(output, answer);
}

@test
Expand Down Expand Up @@ -246,7 +246,7 @@ class RetracedJSTests {
}
}`;

expect(output).to.equal(answer);
assert.strictEqual(output, answer);
}

@test
Expand Down Expand Up @@ -277,7 +277,7 @@ class RetracedJSTests {
};
const output = Retraced.formatRawEventNode(raw);

expect(output).to.deep.equal(answer);
assert.deepEqual(output, answer);
}

@test public "should stringify structured query objects"() {
Expand All @@ -293,7 +293,7 @@ class RetracedJSTests {
const answer = `action:"user.*" crud:c received:2017-06-01T00:00:00.000Z,2017-07-01T00:00:00.000Z actor.name:"Some Actor" actor.id:[email protected] description:"web login"`;
const queryString = Retraced.stringifyStructuredQuery(queryObj);

expect(queryString).to.equal(answer);
assert.strictEqual(queryString, answer);
}

@test public "url format replacement"() {
Expand All @@ -315,7 +315,7 @@ class RetracedJSTests {
view_log_action: "viewLogAction",
});

expect(q).to.equal(result);
expect("?" + sp.toString()).to.equal(result);
assert.strictEqual(q, result);
assert.strictEqual("?" + sp.toString(), result);
}
}

0 comments on commit 4c809de

Please sign in to comment.