Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mocha configuration for watching chanages within test files #883

Merged
merged 2 commits into from
Mar 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
"scripts": {
"test": "npm-run-all -s test:*",
"watch:test": "npm-run-all -p watch:test:*",
"test:common": "mocha --exit --require ./test/setup/mocha.js src/common/**/*.mocha.{ts,tsx}",
"test:client": "mocha --exit --require ./test/setup/mocha.js src/client/**/*.mocha.{ts,tsx}",
"test:server": "mocha --exit --require ./test/setup/mocha.js src/server/**/*.mocha.ts",
"test:common": "mocha --exit --require ./test/setup/mocha.js 'src/common/**/*.mocha.{ts,tsx}'",
"test:client": "mocha --exit --require ./test/setup/mocha.js 'src/client/**/*.mocha.{ts,tsx}' --file 'src/client/utils/test-utils/jsdom-setup.ts'",
"test:server": "mocha --exit --require ./test/setup/mocha.js 'src/server/**/*.mocha.ts'",
"test:client-types": "npm run tsc -- --noEmit -p src/client/tsconfig.json",
"test:size": "size-limit",
"watch:test:common": "npm run test:common -- --watch --watch-extensions ts,tsx",
"watch:test:client": "npm run test:client -- --watch --watch-extensions ts,tsx",
"watch:test:server": "npm run test:server -- --watch --watch-extensions ts,tsx",
"test-watcher": "mocha --require ./test/setup/mocha.js --watch --watch-extensions ts,tsx",
"watch:test:common": "npm run test:common -- --watch --watch-files 'src/common/**/*.mocha.ts'",
"watch:test:client": "npm run test:client -- --watch --watch-files 'src/client/**/*.mocha.tsx' --watch-files 'src/client/**/*.mocha.ts'",
"watch:test:server": "npm run test:server -- --watch --watch-files 'src/server/**/*.mocha.ts'",
"test-watcher": "mocha --require ./test/setup/mocha.js --watch",
"start": "./bin/turnilo",
"start:dev": "NODE_ENV=dev-hmr ./bin/turnilo",
"start:examples": "npm run start -- --examples",
Expand Down
38 changes: 0 additions & 38 deletions src/client/components/notifications/notifications.mocha.tsx

This file was deleted.

1 change: 0 additions & 1 deletion src/client/utils/test-utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
var ExecutionEnvironment = require("../../../../node_modules/fbjs/lib/ExecutionEnvironment");
ExecutionEnvironment.canUseDOM = true;

import "./jsdom-setup";
import "./require-extensions";

export * from "./mock-require-ensure";
Expand Down
3 changes: 3 additions & 0 deletions src/common/models/split/split.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,8 @@ describe("Split", () => {
expect(formatValueStub.calledWith(42, timezone)).to.be.true;
});

afterEach(() => {
formatValueStub.restore();
});
});
});
1 change: 1 addition & 0 deletions src/common/utils/formatter/formatter.mocha.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ describe("General", () => {
const filterClause = FormatterFixtures.fixedTimeFilter(start, end);
formatFilterClause(DimensionFixtures.time(), filterClause, Timezone.UTC);
expect(formatTimeRange.calledWith({ start, end }, Timezone.UTC)).to.equal(true);
formatTimeRange.restore();
});

it("formats number", () => {
Expand Down