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

adding tsconfigs to test folders to reduce jest type errors in vscode #1982

Closed
wants to merge 10 commits into from
Closed
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
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"clean": "lerna run --parallel clean",
"clean:exe": "cd zowex && cargo clean",
"installWithBuild": "npm install && npm run build",
"checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/test-tsconfig.json --noEmit",
"checkTestsCompile": "echo \"Checking that test source compiles...\" && tsc --project __tests__/tsconfig.json --noEmit",
"circularDependencyCheck": "lerna run --parallel circularDependencyCheck -- -- --warning --no-spinner",
"lint": "eslint \"packages/**/*.ts\" \"**/__tests__/**/*.ts\"",
"lint:packages": "eslint \"packages/**/*.ts\" --ignore-pattern \"**/__tests__/**/*.ts\"",
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import { Session } from "@zowe/imperative";
import { Create, Delete, CreateDataSetTypeEnum, Upload } from "@zowe/cli";
import { Create, Delete, CreateDataSetTypeEnum, Upload } from "@zowe/zos-files-for-zowe-sdk";
import * as path from "path";
import {ITestEnvironment, runCliScript} from "@zowe/cli-test-utils";
import {TestEnvironment} from "../../../../../../../__tests__/__src__/environment/TestEnvironment";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

import { Session } from "@zowe/imperative";
import { Create, Delete, CreateDataSetTypeEnum } from "@zowe/cli";
import { Create, Delete, CreateDataSetTypeEnum } from "@zowe/zos-files-for-zowe-sdk";
import * as path from "path";
import {ITestEnvironment, runCliScript} from "@zowe/cli-test-utils";
import {TestEnvironment} from "../../../../../../../__tests__/__src__/environment/TestEnvironment";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@

import { Imperative, Session } from "@zowe/imperative";
import * as path from "path";
import { ZosFilesConstants, ZosmfRestClient, ZosmfHeaders } from "@zowe/cli";
import { ZosFilesConstants } from "../../../../../../zosfiles/src/constants/ZosFiles.constants";
import { ZosmfHeaders, ZosmfRestClient } from "@zowe/core-for-zowe-sdk";
import {ITestEnvironment, runCliScript} from "@zowe/cli-test-utils";
import {TestEnvironment} from "../../../../../../../__tests__/__src__/environment/TestEnvironment";
import {ITestPropertiesSchema} from "../../../../../../../__tests__/__src__/properties/ITestPropertiesSchema";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`zos-tso ping address-space should throw an error if provided address space is inactive 1`] = `
"Command Error:
"Unable to perform this operation due to the following problem.
Expect Error: IZUG1126E: z/OSMF cannot correlate the request for key \\"BadKey\\" with an active z/OS application session.
"
`;
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`zos-tso start address-space should throw an error if provided address space is inactive 1`] = `
"Command Error:
"Unable to perform this operation due to the following problem.
Expect Error: IZUG1126E: z/OSMF cannot correlate the request for key \\"ZOSMFAD-55-aaakaaac\\" with an active z/OS application session.
"
`;

exports[`zos-tso start address-space should throw an error if servlet key parameter is not provided 1`] = `
"Command Error:
"Unable to perform this operation due to the following problem.
Expect Error: IZUG1126E: z/OSMF cannot correlate the request for key \\"ZOSMFAD-55-aaakaaac\\" with an active z/OS application session.
"
`;
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`zos-tso stop should fail with invalid option 1`] = `
"Command Error:
"Unable to perform this operation due to the following problem.
Unknown arguments: foo-bar, fooBar
Command failed due to improper syntax
Command entered: \\"zos-tso start as --foo-bar\\"
Available commands are \\"address-space\\".
Use \\"zowe zos-tso start --help\\" to view groups, commands, and options.
Error Details:

Response From Service
Error: Unknown arguments: foo-bar, fooBar

Diagnostic Information
Unknown arguments: foo-bar, fooBar
"
`;
Expand All @@ -18,15 +22,19 @@ exports[`zos-tso stop should fail with invalid option 2`] = `
`;

exports[`zos-tso stop should fail with invalid parameter 1`] = `
"Command Error:
"Unable to perform this operation due to the following problem.
Unknown argument: foobar
Command failed due to improper syntax
Did you mean: zos-tso stop as?

Command entered: \\"zos-tso stop foobar\\"
Available commands are \\"address-space\\".
Use \\"zowe zos-tso stop --help\\" to view groups, commands, and options.
Error Details:

Response From Service
Error: Unknown argument: foobar

Diagnostic Information
Unknown argument: foobar
"
`;
Expand Down
9 changes: 9 additions & 0 deletions packages/cli/test-tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./lib"
},
"include": [
"./src"
]
}
6 changes: 6 additions & 0 deletions packages/core/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"lib": [
"esnext"
],
"isolatedModules": true,
"target": "es2015",
"module": "commonjs",
"isolatedModules": true,
"declaration": true,
"moduleResolution": "node",
"noImplicitAny": true,
Expand Down
6 changes: 6 additions & 0 deletions packages/imperative/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/provisioning/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/workflows/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/zosconsole/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

import { Create, Delete, CreateDataSetTypeEnum, HDelete, HMigrate, IDeleteOptions, ZosFilesMessages } from "../../../../src";
import { Create, Delete, CreateDataSetTypeEnum, HDelete, HMigrate, IDeleteOptions, ZosFilesMessages } from "@zowe/zos-files-for-zowe-sdk";
import { Imperative, Session } from "@zowe/imperative";
import { inspect } from "util";
import { ITestEnvironment } from "@zowe/cli-test-utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*
*/

import { Create, Delete, CreateDataSetTypeEnum, HMigrate, IListOptions, IMigrateOptions, List, ZosFilesMessages } from "../../../../src";
import { Create, Delete, CreateDataSetTypeEnum, HMigrate, IListOptions, IMigrateOptions, List, ZosFilesMessages } from "@zowe/zos-files-for-zowe-sdk";
import { Imperative, Session } from "@zowe/imperative";
import { inspect } from "util";
import { ITestEnvironment } from "@zowe/cli-test-utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
*
*/

import { Create, Delete, CreateDataSetTypeEnum, HMigrate, HRecall, IListOptions, IRecallOptions, List, ZosFilesMessages } from "../../../../src";
import { Create, Delete, CreateDataSetTypeEnum,
HMigrate, HRecall, IListOptions, IRecallOptions, List, ZosFilesMessages } from "@zowe/zos-files-for-zowe-sdk";
import { Imperative, Session } from "@zowe/imperative";
import { inspect } from "util";
import { ITestEnvironment } from "@zowe/cli-test-utils";
Expand Down
6 changes: 6 additions & 0 deletions packages/zosfiles/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/zosjobs/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/zoslogs/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/zosmf/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/zostso/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
6 changes: 6 additions & 0 deletions packages/zosuss/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../tsconfig.json",
"include": [
"../**/*.ts"
]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"**/__tests__/*",
"**/*.spec.ts",
"**/*-spec.ts",
"**/*.test.ts"
"**/*.test.ts",
"packages/imperative/__tests__"
],
"files": [
"./__types__/wontache.d.ts"
Expand Down
Loading