Skip to content

Commit

Permalink
fix: korjaa testit (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
haapamakim authored Oct 18, 2022
1 parent c3b70db commit 7e3d3b5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions backend/test/projektiSearch/projektiSearchService2.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { describe, it } from "mocha";
import { openSearchClientJulkinen, openSearchClientYllapito } from "../../src/projektiSearch/openSearchClient";
import {
openSearchClientIlmoitustauluSyote,
openSearchClientJulkinen,
openSearchClientYllapito,
} from "../../src/projektiSearch/openSearchClient";
import { projektiSearchService } from "../../src/projektiSearch/projektiSearchService";
import * as sinon from "sinon";
import {
Expand All @@ -24,12 +28,18 @@ const { expect } = require("chai");
describe("ProjektiSearchService", () => {
let openSearchClientYllapitoStub: sinon.SinonStub;
let openSearchClientJulkinenSuomiStub: sinon.SinonStub;
beforeEach(() => {

before(() => {
openSearchClientYllapitoStub = sandbox.stub(openSearchClientYllapito, "putDocument");
sandbox.stub(openSearchClientIlmoitustauluSyote, "putDocument");
openSearchClientJulkinenSuomiStub = sandbox.stub(openSearchClientJulkinen["SUOMI"], "putDocument");
});

afterEach(() => {
sandbox.reset();
});

after(() => {
sandbox.restore();
});

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@
"test": "npm-run-all --aggregate-output --parallel test:frontend test:coverage test:integration:coverage",
"husky:test": "npm-run-all --aggregate-output --parallel \"test:!(backend|integration)\"",
"test:frontend": "jest --config \"./jest.frontend.config.js\"",
"test:backend": "cross-env TS_NODE_PROJECT=\"./backend/tsconfig.json\" mocha -r ts-node/register \"backend/test/**/*.test.ts\" --reporter mocha-multi-reporters --reporter-options configFile=mocha_reporter_config.json",
"test:backend": "cross-env AWS_PROFILE=nonexistent TS_NODE_PROJECT=\"./backend/tsconfig.json\" mocha -r ts-node/register \"backend/test/**/*.test.ts\" --reporter mocha-multi-reporters --reporter-options configFile=mocha_reporter_config.json",
"test:coverage": "nyc --report-dir .report/coverage --reporter text-summary --reporter lcov --reporter json --reporter clover npm run test:backend",
"test:integration": "cross-env TS_NODE_PROJECT=\"./backend/tsconfig.json\" mocha -r ts-node/register \"backend/integrationtest/**/*.test.ts\" --reporter mocha-multi-reporters --reporter-options configFile=mocha_reporter_config_integration.json",
"test:integration:coverage": "nyc --report-dir .report/coverage --reporter text-summary --reporter lcov --reporter json --reporter clover npm run test:integration",
"watch:test:frontend": "jest --config \"./jest.frontend.config.js\" --watch",
"watch:test:backend": "cross-env TS_NODE_PROJECT=\"./backend/tsconfig.json\" mocha $NODE_DEBUG_OPTION -r dotenv/config --require ts-node/register --watch --watch-extensions ts --watch-files backend --watch-files common \"backend/test/**/*.test.ts\"",
"watch:test:backend": "cross-env AWS_PROFILE=nonexistent TS_NODE_PROJECT=\"./backend/tsconfig.json\" mocha $NODE_DEBUG_OPTION -r dotenv/config --require ts-node/register --watch --watch-extensions ts --watch-files backend --watch-files common \"backend/test/**/*.test.ts\"",
"watch:test:integration": "cross-env TS_NODE_PROJECT=\"./backend/tsconfig.json\" mocha $NODE_DEBUG_OPTION -r dotenv/config --require ts-node/register --watch --watch-extensions ts --watch-files backend --watch-files common \"backend/integrationtest/**/*.test.ts\"",
"deploy:database": "cdk --app \"ts-node --project=tsconfig.cdk.json ./deployment/bin/hassu\" deploy database --require-approval never",
"postdeploy:database": "npm run setupenvironment",
Expand Down

0 comments on commit 7e3d3b5

Please sign in to comment.