Skip to content

Commit 603ea18

Browse files
authored
fix: Import path fixed (#149)
1 parent 755736d commit 603ea18

14 files changed

+83
-81
lines changed

lib/helpers/config.helper.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
validateConfig,
55
} from "./config.helper";
66
import { mocked } from "ts-jest/utils";
7-
import { Config } from "types";
7+
import { Config } from "../types";
88
import * as fs from "fs";
99

1010
jest.mock("fs");

lib/helpers/config.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { existsSync, readFileSync } from "fs";
2-
import { Config } from "types";
2+
import { Config } from "../types";
33

44
const CONFIG_FILE_PATH = "./vrt.json";
55

lib/helpers/dto.helper.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { multipartDtoToFormData, bufferDtoToFormData } from "./index";
2-
import { TestRunBufferDto, TestRunMultipartDto } from "types/request";
2+
import { TestRunBufferDto, TestRunMultipartDto } from "../types";
33
import { mocked } from "ts-jest/utils";
44
import * as fs from "fs";
55

lib/helpers/dto.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import FormData from "form-data";
22
import fs from "fs";
3-
import { TestRunMultipartDto, TestRunBufferDto } from "types/request";
3+
import { TestRunMultipartDto, TestRunBufferDto } from "../types";
44

55
export const multipartDtoToFormData = (dto: TestRunMultipartDto): FormData => {
66
const data = new FormData();

lib/helpers/type.helper.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TestRunBase64, TestRunMultipart } from "types";
1+
import { TestRunBase64, TestRunMultipart } from "../types";
22
import { instanceOfTestRunBase64 } from "./index";
33

44
describe("instanceOfTestRunBase64", () => {

lib/helpers/type.helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { TestRunBase64, TestRunBuffer } from "types";
1+
import { TestRunBase64, TestRunBuffer } from "../types";
22

33
export function instanceOfTestRunBase64(object: any): object is TestRunBase64 {
44
return "imageBase64" in object;

lib/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export * from "./visualRegressionTracker";
22
export * from "./testRunResult";
33
export * from "./types";
4+
export * from "./helpers";

lib/types/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
export * from "./config";
22
export * from "./testRun";
3+
export * from "./request";
34
export * from "./response/buildResponse";
45
export * from "./response/testRunResponse";
56
export * from "./testStatus";

lib/types/request/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from "./testRunBase64.dto";
22
export * from "./testRunMultipart.dto";
3-
export * from "./testRunBuffer.dto";
3+
export * from "./testRunBuffer.dto";

lib/types/request/testRun.dto.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { IgnoreArea } from "types/ignoreArea";
1+
import { IgnoreArea } from "../../types/ignoreArea";
22

33
export interface TestRunDto {
44
name: string;

lib/visualRegressionTracker.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
import axios, { AxiosError, AxiosResponse } from "axios";
2+
import { mocked } from "ts-jest/utils";
3+
import FormData from "form-data";
4+
15
import { VisualRegressionTracker } from "./visualRegressionTracker";
26
import {
37
Config,
@@ -8,12 +12,9 @@ import {
812
TestRunMultipart,
913
TestRunBuffer,
1014
} from "./types";
11-
import { mocked } from "ts-jest/utils";
1215
import TestRunResult from "./testRunResult";
13-
import axios, { AxiosError, AxiosResponse } from "axios";
1416
import * as configHelper from "./helpers/config.helper";
1517
import * as dtoHelper from "./helpers/dto.helper";
16-
import FormData from "form-data";
1718

1819
jest.mock("axios");
1920
const mockedAxios = mocked(axios, true);

lib/visualRegressionTracker.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import FormData from "form-data";
2+
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
3+
24
import {
35
Config,
46
BuildResponse,
@@ -7,9 +9,9 @@ import {
79
TestRunMultipart,
810
TestRunBase64,
911
TestRunBuffer,
12+
TestRunBase64Dto,
1013
} from "./types";
1114
import TestRunResult from "./testRunResult";
12-
import axios, { AxiosRequestConfig, AxiosResponse, AxiosError } from "axios";
1315
import {
1416
instanceOfTestRunBase64,
1517
readConfigFromEnv,
@@ -19,7 +21,6 @@ import {
1921
instanceOfTestRunBuffer,
2022
bufferDtoToFormData,
2123
} from "./helpers";
22-
import { TestRunBase64Dto } from "types/request";
2324

2425
export class VisualRegressionTracker {
2526
private config: Config = {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tsconfig.json

Lines changed: 64 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,65 @@
11
{
2-
"compilerOptions": {
3-
/* Basic Options */
4-
"target": "ES2015",
5-
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
6-
"module": "commonjs",
7-
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
8-
// "lib": [], /* Specify library files to be included in the compilation. */
9-
// "allowJs": true, /* Allow javascript files to be compiled. */
10-
// "checkJs": true, /* Report errors in .js files. */
11-
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
12-
"declaration": true, /* Generates corresponding '.d.ts' file. */
13-
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
14-
// "sourceMap": true, /* Generates corresponding '.map' file. */
15-
// "outFile": "./", /* Concatenate and emit output to single file. */
16-
// "outDir": "./", /* Redirect output structure to the directory. */
17-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
18-
// "composite": true, /* Enable project compilation */
19-
// "removeComments": true, /* Do not emit comments to output. */
20-
// "noEmit": true, /* Do not emit outputs. */
21-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
22-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
23-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
24-
25-
/* Strict Type-Checking Options */
26-
"strict": true,
27-
/* Enable all strict type-checking options. */
28-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
29-
// "strictNullChecks": true, /* Enable strict null checks. */
30-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
31-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
32-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
33-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
34-
35-
/* Additional Checks */
36-
// "noUnusedLocals": true, /* Report errors on unused locals. */
37-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
38-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
39-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
40-
41-
/* Module Resolution Options */
42-
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
43-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
44-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
45-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
46-
// "typeRoots": [], /* List of folders to include type definitions from. */
47-
// "types": [], /* Type declaration files to be included in compilation. */
48-
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
49-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
50-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
51-
52-
/* Source Map Options */
53-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
54-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
55-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
56-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
57-
58-
/* Experimental Options */
59-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
60-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
61-
"baseUrl": "./lib",
62-
"outDir": "./dist"
63-
},
64-
"include": [
65-
"lib/**/*"
66-
]
67-
}
2+
"compilerOptions": {
3+
/* Basic Options */
4+
"target": "ES2015",
5+
/* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */
6+
"module": "commonjs",
7+
/* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
8+
// "lib": [], /* Specify library files to be included in the compilation. */
9+
// "allowJs": true, /* Allow javascript files to be compiled. */
10+
// "checkJs": true, /* Report errors in .js files. */
11+
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
12+
"declaration": true, /* Generates corresponding '.d.ts' file. */
13+
// "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
14+
// "sourceMap": true, /* Generates corresponding '.map' file. */
15+
// "outFile": "./", /* Concatenate and emit output to single file. */
16+
// "outDir": "./", /* Redirect output structure to the directory. */
17+
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
18+
// "composite": true, /* Enable project compilation */
19+
// "removeComments": true, /* Do not emit comments to output. */
20+
// "noEmit": true, /* Do not emit outputs. */
21+
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
22+
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
23+
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
24+
/* Strict Type-Checking Options */
25+
"strict": true,
26+
/* Enable all strict type-checking options. */
27+
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
28+
// "strictNullChecks": true, /* Enable strict null checks. */
29+
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
30+
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
31+
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
32+
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
33+
/* Additional Checks */
34+
// "noUnusedLocals": true, /* Report errors on unused locals. */
35+
// "noUnusedParameters": true, /* Report errors on unused parameters. */
36+
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
37+
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
38+
/* Module Resolution Options */
39+
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
40+
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
41+
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
42+
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
43+
// "typeRoots": [], /* List of folders to include type definitions from. */
44+
// "types": [], /* Type declaration files to be included in compilation. */
45+
"allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
46+
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
47+
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
48+
/* Source Map Options */
49+
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
50+
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
51+
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
52+
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
53+
/* Experimental Options */
54+
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
55+
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
56+
"baseUrl": "./lib",
57+
"outDir": "./dist",
58+
},
59+
"include": [
60+
"lib/**/*"
61+
],
62+
"exclude": [
63+
"**/*.spec.ts",
64+
]
65+
}

0 commit comments

Comments
 (0)