Skip to content

Commit

Permalink
test(vite): replacing moch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake Lauer authored and Jake Lauer committed Jul 21, 2024
1 parent dedf27b commit f841a0e
Show file tree
Hide file tree
Showing 57 changed files with 613 additions and 524 deletions.
17 changes: 0 additions & 17 deletions .mocharc.cjs

This file was deleted.

21 changes: 7 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
"commit": "cz",
"lint": "git add . && pnpm lint-staged",
"lint-fix": "eslint ./ --fix --resolve-plugins-relative-to=./",
"test:debug": "cross-env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha --exit --config ./.mocharc.cjs --theseus-log-level debug",
"test:pkg": "pnpm -r run test",
"test:pkg:sandbox": "pnpm -r run test",
"test:base": "ts-mocha --paths --exit --config ./.mocharc.cjs",
"test": "pnpm test:pkg && pnpm test:base",
"test": "vitest run",
"// ==== BUILD ==== //": "",
"build:base": "tsup && resolve-tspaths",
"build:ci": "pnpm build:base",
Expand All @@ -37,7 +35,9 @@
"// ==== EXAMPLES ==== //": "",
"example:ttt": "pnpm --prefix ./.examples/tic-tac-toe start",
"// === HELPERS === //": "",
"package": "sh -c 'pnpm --prefix ./packages/$0 run $1'"
"package": "sh -c 'pnpm --prefix ./packages/$0 run $1'",
"test:watch": "vitest watch",
"coverage": "vitest run --coverage"
},
"dependencies": {
"@ungap/structured-clone": "^1.2.0",
Expand All @@ -62,7 +62,6 @@
"@types/deep-equal": "^1.0.4",
"@types/deep-extend": "^0.6.2",
"@types/deep-freeze-strict": "^1.1.2",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.25",
"@types/promise.allsettled": "^1.0.6",
"@types/sinon": "^17.0.3",
Expand All @@ -77,15 +76,12 @@
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-mocha": "^10.4.1",
"eslint-plugin-require-extensions": "0.1.3",
"eslint-plugin-theseus": "workspace:~",
"eslint-plugin-unused-imports": "^3.1.0",
"glob": "^10.4.1",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"mocha": "^10.3.0",
"mocha-suppress-logs": "^0.4.1",
"prettier": "^3.2.5",
"prettier-eslint": "^16.3.0",
"quibble": "0.9.2",
Expand All @@ -98,18 +94,15 @@
"theseus-gpt-zip": "workspace:~",
"theseus-logger": "workspace:~",
"theseus-sandbox": "workspace:~",
"ts-mocha": "^10.0.0",
"ts-node": "10.9.2",
"tsconfig-paths": "^4.2.0",
"tsup": "^8.1.0",
"typescript": "^5.4.5",
"vitest": "^2.0.3"
"vitest": "^1.0.1",
"@vitest/coverage-v8": "^1.0.1"
},
"lint-staged": {
"*.ts": [
"prettier --write",
"eslint --fix --resolve-plugins-relative-to=./"
]
"*.ts": ["prettier --write", "eslint --fix --resolve-plugins-relative-to=./"]
},
"main": "dist/index.cjs",
"module": "dist/index.js",
Expand Down
14 changes: 0 additions & 14 deletions packages/eslint-plugin-theseus/.mocharc.cjs

This file was deleted.

7 changes: 5 additions & 2 deletions packages/eslint-plugin-theseus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
"main": "lib/index.js",
"scripts": {
"build": "echo 'no build'",
"test": "mocha --exit --config ./.mocharc.cjs"
"test": "vitest run",
"test:watch": "vitest watch",
"coverage": "vitest run --coverage"
},
"devDependencies": {
"eslint": "^8.57.0",
"mocha": "^10.3.0"
"vitest": "^1.0.1",
"@vitest/coverage-v8": "^1.0.1"
},
"keywords": [],
"author": "Jake Lauer",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-theseus/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compileOnSave": false,
"include": ["./lib/rules/*"],
"exclude": ["./lib/_test/*.js"],
"exclude": ["./lib/_test/*.js"],
"compilerOptions": {
"allowJs": true,
"rootDir": "./lib",
Expand Down
14 changes: 0 additions & 14 deletions packages/logger/.mocharc.cjs

This file was deleted.

4 changes: 3 additions & 1 deletion packages/logger/lib/_test/set-theseus-log-level.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import sinon from "sinon";
import {
expect, afterEach, describe, it,
} from "vitest";
import { setTheseusLogLevel } from "../set-theseus-log-level.js";
import type { logLevels } from "../log-levels.js";

Expand Down
4 changes: 3 additions & 1 deletion packages/logger/lib/_test/stringifier.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { stringifier } from "../stringifier.js";
import {
expect, describe, it,
} from "vitest";
import { sandbox } from "theseus-sandbox";

describe("stringifier", function ()
Expand Down
4 changes: 2 additions & 2 deletions packages/logger/lib/_test/winston-config-builder.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect } from "chai";
import { expect, describe } from "vitest";

describe("Winston Configuration Builder", function()
describe("Winston Configuration Builder", function ()
{
// Not testing this stuff
expect(true).to.be.true;
Expand Down
13 changes: 7 additions & 6 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
"type": "module",
"scripts": {
"build": "tsup",
"test": "tsx --tsconfig=tsconfig.test.json ./node_modules/mocha/bin/mocha.js --exit --config ./.mocharc.cjs"
"test": "vitest run",
"test:watch": "vitest watch",
"coverage": "vitest run --coverage"
},
"keywords": [
"logger"
],
"keywords": ["logger"],
"author": "",
"license": "ISC",
"dependencies": {
Expand All @@ -21,10 +21,11 @@
"devDependencies": {
"@types/sinon": "^17.0.3",
"@types/sinon-chai": "^3.2.12",
"mocha": "^10.3.0",
"sinon": "^18.0.0",
"sinon-chai": "^3.7.0",
"tsx": "4.11.2",
"typescript": "^5.4.2"
"typescript": "^5.4.2",
"vitest": "^1.0.1",
"@vitest/coverage-v8": "^1.0.1"
}
}
14 changes: 0 additions & 14 deletions packages/sandbox/.mocharc.cjs

This file was deleted.

4 changes: 3 additions & 1 deletion packages/sandbox/lib/_test/bad-cards.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { GetMockGameItem } from "./bad-cards.test-dep.js";
import {
expect, describe, it,
} from "vitest";
import { sandbox } from "../actions/sandbox/index.js";
import { expect } from "chai";
import { cement } from "../actions/cement/cement.js";
import { defrost, frost } from "../actions/frost/index.js";
import { isFrost } from "../actions/frost/detect/is-frost-proxy.js";
Expand Down
5 changes: 3 additions & 2 deletions packages/sandbox/lib/_test/type-tests.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { expect } from "chai";
import sinonChai from "sinon-chai";
import {
expect, afterEach, beforeEach, describe, it,
} from "vitest";
import sinon from "sinon";
import { sandbox } from "../actions/sandbox/sandbox.js";
import chai from "chai";
import {
cement, frost, isFrost, isSandbox,
} from "../index.js";
Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/cement/_test/cement.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { cement } from "../cement.js";
import {
expect, describe, it,
} from "vitest";
import { CONSTANTS } from "sandbox-constants";
import {
containsSandbox, isSandbox, sandbox,
Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/frost/_test/assertions.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { CONSTANTS } from "sandbox-constants";
import {
expect, describe, it,
} from "vitest";
import { assertValidVerificationProperty } from "../assertions.js";

describe("assertValidVerificationProperty", function ()
Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/frost/_test/defrost.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { frost } from "../frost.js";
import {
expect, beforeEach, describe, it,
} from "vitest";
import { sandbox } from "../../sandbox/sandbox.js";
import { cement } from "../../cement/cement.js";
import { isSandbox } from "../../sandbox/index.js";
Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/frost/_test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { frost } from "../frost.js";
import {
expect, beforeEach, describe, it,
} from "vitest";
import { sandbox } from "../../sandbox/sandbox.js";
import { cement } from "../../cement/cement.js";

Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/frost/_test/properties.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { extractVerificationPropValues, propertyStartsWith } from "../properties.js";
import {
expect, describe, it,
} from "vitest";

describe("propertyStartsWith", function ()
{
Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/frost/_test/prototypes.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { isSandbox, sandbox } from "../../sandbox/index.js";
import {
expect, describe, it,
} from "vitest";

describe("Prototype tests", function ()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe } from "mocha";
import { frost } from "../../frost.js";
import { expect, it } from "vitest";
import { containsFrost, isFrost } from "../is-frost-proxy.js";
import { expect } from "chai";

describe("is-frost-proxy", function ()
"is-frost-proxy",
function ()
{
it("should correctly identify a sandbox proxy object", function ()
{
Expand Down Expand Up @@ -37,4 +37,4 @@ describe("is-frost-proxy", function ()
expect(isFrost(original, "every")).to.equal(false);
expect(isFrost(original, "some")).to.equal(true);
});
});
};
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { expect } from "chai";

// Mock the assertValidVerificationProperty and extractVerificationPropValues functions
import sinon from "sinon";

import {
expect, describe, it,
} from "vitest";
import { CONSTANTS } from "sandbox-constants";
import { proxyDelete } from "../proxy-delete.js";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { proxyGet } from "../proxy-get.js";
import {
expect, describe, it,
} from "vitest";
import { CONSTANTS } from "sandbox-constants";
import { assertValidVerificationProperty } from "../../assertions.js";
import { extractVerificationPropValues } from "../../properties.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { expect } from "chai";

// Mock the assertValidVerificationProperty function
import { SANDBOX_VERIFIABLE_PROP_SYMBOL, CONSTANTS } from "sandbox-constants";

import {
expect, describe, it,
} from "vitest";
import { proxySet } from "../proxy-set.js";
import type { SandboxSettable } from "../../types.js";

Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/reject/_test/reject.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { reject } from "../reject.js";
import {
expect, describe, it,
} from "vitest";
import { CONSTANTS } from "sandbox-constants";

describe("reject", function ()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { getSandboxChanges } from "../get-sandbox-changes.js";
import {
expect, describe, it,
} from "vitest";
import { CONSTANTS } from "sandbox-constants";

describe("getSandboxChanges", function ()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import sinon from "sinon";
import {
expect, describe, it,
} from "vitest";
import { sandboxTransform } from "../sandbox-transform.js";

describe("deepSandboxTransform", function ()
Expand Down
4 changes: 3 additions & 1 deletion packages/sandbox/lib/actions/sandbox/_test/sandbox.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect } from "chai";
import { sandbox } from "../sandbox.js";
import {
expect, describe, it,
} from "vitest";
import { isSandbox } from "../detect/is-sandbox-proxy.js";
import { CONSTANTS } from "sandbox-constants";
import { cement } from "../../cement/cement.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe } from "mocha";
import { sandbox } from "../../sandbox.js";
import { expect, it } from "vitest";
import { containsSandbox, isSandbox } from "../is-sandbox-proxy.js";
import { expect } from "chai";

describe("is-sandbox-proxy", function ()
"is-sandbox-proxy",
function ()
{
it("should correctly identify a sandbox proxy object", function ()
{
Expand Down Expand Up @@ -35,4 +35,4 @@ describe("is-sandbox-proxy", function ()
};
expect(containsSandbox(original)).to.equal(true);
});
});
};
Loading

0 comments on commit f841a0e

Please sign in to comment.