Skip to content

Commit

Permalink
Fix prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
HarelM committed Apr 26, 2024
1 parent b291b86 commit 5cff711
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 61 deletions.
12 changes: 5 additions & 7 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* https://jestjs.io/docs/configuration
*/

import type {Config} from 'jest';
import type { Config } from 'jest';

const config: Config = {
// All imported modules in your tests should be mocked automatically
Expand All @@ -25,15 +25,15 @@ const config: Config = {
// collectCoverageFrom: undefined,

// The directory where Jest should output its coverage files
coverageDirectory: "coverage",
coverageDirectory: 'coverage',

// An array of regexp pattern strings used to skip coverage collection
// coveragePathIgnorePatterns: [
// "/node_modules/"
// ],

// Indicates which provider should be used to instrument code for coverage
coverageProvider: "v8",
coverageProvider: 'v8',

// A list of reporter names that Jest uses when writing coverage reports
// coverageReporters: [
Expand Down Expand Up @@ -102,7 +102,7 @@ const config: Config = {
// notifyMode: "failure-change",

// A preset that is used as a base for Jest's configuration
preset: "ts-jest",
preset: 'ts-jest',

// Run tests from one or more projects
// projects: undefined,
Expand Down Expand Up @@ -155,9 +155,7 @@ const config: Config = {
// testLocationInResults: false,

// The glob patterns Jest uses to detect test files
testMatch: [
"**/*.spec.ts"
],
testMatch: ['**/*.spec.ts'],

// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
// testPathIgnorePatterns: [
Expand Down
2 changes: 1 addition & 1 deletion spec/e2e.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import builderPackage, {type Builder} from "../lib";
import builderPackage, { type Builder } from '../lib';
//@ts-ignore
import rmdir from 'rimraf';
import fs from 'fs';
Expand Down
13 changes: 7 additions & 6 deletions spec/test_case.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ describe('Test Case builder', () => {
let systemOutElement: XMLElement;
let systemErrElement: XMLElement;

const createElementMock = () => ({
ele: jest.fn(),
cdata: jest.fn(),
att: jest.fn(),
txt: jest.fn()
} as unknown as XMLElement);
const createElementMock = () =>
({
ele: jest.fn(),
cdata: jest.fn(),
att: jest.fn(),
txt: jest.fn(),
}) as unknown as XMLElement;

beforeEach(() => {
testCase = new TestCase();
Expand Down
12 changes: 6 additions & 6 deletions spec/test_suite.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ describe('Test Suite builder', () => {
getFailureCount: jest.fn().mockReturnValue(0),
getErrorCount: jest.fn().mockReturnValue(0),
getSkippedCount: jest.fn().mockReturnValue(0),
getTestCaseCount: jest.fn().mockReturnValue(1)
getTestCaseCount: jest.fn().mockReturnValue(1),
} as unknown as TestCase;

const factory = {
newTestCase: jest.fn().mockReturnValue(testCase)
newTestCase: jest.fn().mockReturnValue(testCase),
} as unknown as Factory;

propertiesElement = { ele: jest.fn() } as unknown as XMLElement;
testSuiteElement = {
testSuiteElement = {
ele: jest.fn().mockImplementation((elementName: string) => {
switch (elementName) {
case 'properties':
return propertiesElement;
}
throw new Error(`Unexpected element name: ${elementName}`);
})
}),
} as unknown as XMLElement;
parentElement = {
parentElement = {
ele: jest.fn().mockImplementation((elementName: string) => {
switch (elementName) {
case 'testsuite':
return testSuiteElement;
}
throw new Error(`Unexpected element name: ${elementName}`);
})
}),
} as unknown as XMLElement;
testSuite = new TestSuite(factory);
});
Expand Down
7 changes: 5 additions & 2 deletions src/test_group.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import {TestNode} from './test_node';
import { TestNode } from './test_node';
import type { TestCase } from './test_case';
import type { XMLElement } from 'xmlbuilder';
import type { Factory } from './factory';
Expand All @@ -12,7 +12,10 @@ export class TestGroup extends TestNode {
* @param factory
* @param elementName
*/
constructor(protected _factory: Factory, elementName: string) {
constructor(
protected _factory: Factory,
elementName: string,
) {
super(elementName);
this._children = [];
}
Expand Down
4 changes: 2 additions & 2 deletions src/test_node.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import _ from 'lodash';
import xmlBuilder, {type XMLElement} from 'xmlbuilder';
import xmlBuilder, { type XMLElement } from 'xmlbuilder';

export abstract class TestNode {
private _elementName: string;
Expand Down Expand Up @@ -61,7 +61,7 @@ export abstract class TestNode {
/**
* @returns the number of skipped test cases
*/
public abstract getSkippedCount(): number
public abstract getSkippedCount(): number;

/**
* @param parentElement - the parent element
Expand Down
1 change: 0 additions & 1 deletion src/test_suites.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { TestGroup } from './test_group';
import type { Factory } from './factory';

export class TestSuites extends TestGroup {

/**
* @param factory
*/
Expand Down
64 changes: 28 additions & 36 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,36 @@
{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"moduleResolution": "node",
"lib": [
"es2015"
],
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"moduleResolution": "node",
"lib": ["es2015"],

"rootDir": "src",
"outDir": "lib",
"rootDir": "src",
"outDir": "lib",

"strict": true,
"alwaysStrict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,
"strict": true,
"alwaysStrict": true,
"strictFunctionTypes": true,
"strictNullChecks": true,
"strictPropertyInitialization": true,

"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": true,

"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"downlevelIteration": true,
"declaration": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"downlevelIteration": true,
"declaration": true,

"pretty": true,
"esModuleInterop": true,
"pretty": true,
"esModuleInterop": true,

"types": [
"node",
"jest"
]
},
"include": [
"typings/**/*",
"src/**/*"
]
"types": ["node", "jest"]
},
"include": ["typings/**/*", "src/**/*"]
}

0 comments on commit 5cff711

Please sign in to comment.