Skip to content

Commit 24f3435

Browse files
committed
Lint tests
1 parent d9afaec commit 24f3435

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+257
-294
lines changed

dev.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { parseWsdl } from "./src/parser";
22

33
(async function () {
4-
const d = await parseWsdl("./test/resources/strict/EVacSyncService_SPClient.wsdl", { modelNamePreffix: "", modelNameSuffix: "" });
5-
})();
4+
const d = await parseWsdl("./test/resources/strict/EVacSyncService_SPClient.wsdl", {
5+
modelNamePreffix: "",
6+
modelNameSuffix: "",
7+
});
8+
})();

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"dev": "ts-node -T ./dev.ts",
2121
"dist": "tsc",
2222
"build": "tsc",
23-
"lint": "eslint ./src",
24-
"lint:fix": "eslint --fix ./src"
23+
"lint": "eslint '**/*.ts'",
24+
"lint:fix": "eslint --fix '**/*.ts'"
2525
},
2626
"repository": {
2727
"type": "git",

src/generator.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export async function generate(
280280
namedImports: [
281281
{ name: "Client", alias: "SoapClient" },
282282
{ name: "createClientAsync", alias: "soapCreateClientAsync" },
283-
{ name: "IExOptions", alias: "ISoapExOptions" }
283+
{ name: "IExOptions", alias: "ISoapExOptions" },
284284
],
285285
});
286286
clientFile.addImportDeclarations(clientImports);

src/parser.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ interface ParserOptions {
1111
modelNamePreffix: string;
1212
modelNameSuffix: string;
1313
maxRecursiveDefinitionName: number;
14-
caseInsensitiveNames: boolean
14+
caseInsensitiveNames: boolean;
1515
}
1616

1717
const defaultOptions: ParserOptions = {
1818
modelNamePreffix: "",
1919
modelNameSuffix: "",
2020
maxRecursiveDefinitionName: 64,
21-
caseInsensitiveNames: false
21+
caseInsensitiveNames: false,
2222
};
2323

2424
type VisitedDefinition = {
@@ -259,7 +259,7 @@ export async function parseWsdl(wsdlPath: string, options: Partial<ParserOptions
259259
maxStack: options.maxRecursiveDefinitionName,
260260
caseInsensitiveNames: options.caseInsensitiveNames,
261261
modelNamePreffix: options.modelNamePreffix,
262-
modelNameSuffix: options.modelNameSuffix
262+
modelNameSuffix: options.modelNameSuffix,
263263
});
264264
const filename = path.basename(wsdlPath);
265265
parsedWsdl.name = changeCase(stripExtension(filename), {

test/node-soap/array_namespace_override.test.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "array_namespace_override.wsdl";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - check definitions`, async t => {
20+
t.test(`${target} - check definitions`, async (t) => {
2121
t.equal(existsSync(`${outdir}/arraynamespaceoverride/definitions/Items.ts`), true);
2222
t.equal(existsSync(`${outdir}/arraynamespaceoverride/definitions/Markdowns.ts`), true);
2323
t.equal(existsSync(`${outdir}/arraynamespaceoverride/definitions/Order.ts`), true);
@@ -27,8 +27,8 @@ test(target, async t => {
2727
t.end();
2828
});
2929

30-
t.test(`${target} - compile`, async t => {
30+
t.test(`${target} - compile`, async (t) => {
3131
await typecheck(`${outdir}/arraynamespaceoverride/index.ts`);
32-
t.end();
32+
t.end();
3333
});
34-
});
34+
});

test/node-soap/attachments.test.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "attachments";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.wsdl`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - check definitions`, async t => {
20+
t.test(`${target} - check definitions`, async (t) => {
2121
t.equal(existsSync(`${outdir}/attachments/definitions/Request.ts`), true);
2222
t.end();
2323
});
2424

25-
t.test(`${target} - compile`, async t => {
25+
t.test(`${target} - compile`, async (t) => {
2626
await typecheck(`${outdir}/attachments/index.ts`);
2727

28-
t.end();
28+
t.end();
2929
});
30-
31-
});
30+
});

test/node-soap/binding-exception.test.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "binding-exception";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.wsdl`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - check definitions`, async t => {
20+
t.test(`${target} - check definitions`, async (t) => {
2121
t.equal(existsSync(`${outdir}/bindingexception/definitions/LoginUserRequest.ts`), true);
2222
t.equal(existsSync(`${outdir}/bindingexception/definitions/LoginUserResponse.ts`), true);
2323
t.end();
2424
});
2525

26-
t.test(`${target} - compile`, async t => {
26+
t.test(`${target} - compile`, async (t) => {
2727
await typecheck(`${outdir}/bindingexception/index.ts`);
28-
t.end();
28+
t.end();
2929
});
30-
31-
});
30+
});

test/node-soap/binding_document.test.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,19 @@ import { typecheck } from "../utils/tsc";
55

66
const target = "binding_document";
77

8-
test(target, async t => {
8+
test(target, async (t) => {
99
Logger.disabled();
1010

1111
const input = `./test/resources/${target}.wsdl`;
1212
const outdir = "./test/generated";
1313

14-
t.test(`${target} - generate wsdl client`, async t => {
14+
t.test(`${target} - generate wsdl client`, async (t) => {
1515
await parseAndGenerate(input, outdir);
1616
t.end();
1717
});
1818

19-
t.test(`${target} - compile`, async t => {
19+
t.test(`${target} - compile`, async (t) => {
2020
await typecheck(`${outdir}/bindingdocument/index.ts`);
21-
t.end();
21+
t.end();
2222
});
23-
24-
});
23+
});

test/node-soap/builtin_types.test.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,27 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "builtin_types";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.wsdl`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - check definitions`, async t => {
20+
t.test(`${target} - check definitions`, async (t) => {
2121
t.equal(existsSync(`${outdir}/builtintypes/definitions/Xsduration.ts`), true);
2222
t.equal(existsSync(`${outdir}/builtintypes/definitions/XsnonNegativeInteger.ts`), true);
2323
t.equal(existsSync(`${outdir}/builtintypes/definitions/XsnonNegativeInteger1.ts`), true);
2424
t.equal(existsSync(`${outdir}/builtintypes/definitions/Xsstring.ts`), true);
2525
t.end();
2626
});
2727

28-
t.test(`${target} - compile`, async t => {
28+
t.test(`${target} - compile`, async (t) => {
2929
await typecheck(`${outdir}/builtintypes/index.ts`);
30-
t.end();
30+
t.end();
3131
});
32-
3332
});
34-

test/node-soap/common.test.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "Common";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.xsd`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - compile`, async t => {
20+
t.test(`${target} - compile`, async (t) => {
2121
await typecheck(`${outdir}/common/index.ts`);
22-
t.end();
22+
t.end();
2323
});
24-
25-
});
24+
});

test/node-soap/connection/econnrefused.test.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,19 @@ import { typecheck } from "../../utils/tsc";
66

77
const target = "connection/econnrefused";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.wsdl`;
1313
const outdir = "./test/generated/connection";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
try {
17-
await parseAndGenerate(input, outdir)
17+
await parseAndGenerate(input, outdir);
1818
t.fail("Should throw error ECONNREFUSED 127.0.0.1:1");
1919
} catch (err) {
2020
t.ok(err, "Got error");
2121
}
2222
t.end();
2323
});
24-
25-
});
24+
});

test/node-soap/cross_schema.test.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "cross_schema";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.wsdl`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - check definitions`, async t => {
20+
t.test(`${target} - check definitions`, async (t) => {
2121
t.equal(existsSync(`${outdir}/crossschema/definitions/OperationResponse.ts`), true);
2222
t.equal(existsSync(`${outdir}/crossschema/definitions/OperationReturn.ts`), true);
2323
t.end();
@@ -26,7 +26,6 @@ test(target, async t => {
2626
// TODO: Finish
2727
// t.test(`${target} - compile`, async t => {
2828
// await typecheck(`${outdir}/crossschema/index.ts`);
29-
// t.end();
29+
// t.end();
3030
// });
31-
32-
});
31+
});

test/node-soap/default_namespace.test.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,26 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "default_namespace";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.wsdl`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - check definitions`, async t => {
20+
t.test(`${target} - check definitions`, async (t) => {
2121
t.equal(existsSync(`${outdir}/defaultnamespace/definitions/Request.ts`), true);
2222
t.equal(existsSync(`${outdir}/defaultnamespace/definitions/Response.ts`), true);
2323
t.end();
2424
});
2525

26-
t.test(`${target} - compile`, async t => {
26+
t.test(`${target} - compile`, async (t) => {
2727
await typecheck(`${outdir}/defaultnamespace/index.ts`);
2828

29-
t.end();
29+
t.end();
3030
});
31-
32-
});
31+
});

test/node-soap/default_namespace_schema_soap12.test.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ import { typecheck } from "../utils/tsc";
66

77
const target = "default_namespace_soap12";
88

9-
test(target, async t => {
9+
test(target, async (t) => {
1010
Logger.disabled();
1111

1212
const input = `./test/resources/${target}.wsdl`;
1313
const outdir = "./test/generated";
1414

15-
t.test(`${target} - generate wsdl client`, async t => {
15+
t.test(`${target} - generate wsdl client`, async (t) => {
1616
await parseAndGenerate(input, outdir);
1717
t.end();
1818
});
1919

20-
t.test(`${target} - check definitions`, async t => {
20+
t.test(`${target} - check definitions`, async (t) => {
2121
t.equal(existsSync(`${outdir}/defaultnamespacesoap12/definitions/Request.ts`), true);
2222
t.equal(existsSync(`${outdir}/defaultnamespacesoap12/definitions/Response.ts`), true);
2323
t.end();
2424
});
2525

26-
t.test(`${target} - compile`, async t => {
26+
t.test(`${target} - compile`, async (t) => {
2727
await typecheck(`${outdir}/defaultnamespacesoap12/index.ts`);
28-
t.end();
28+
t.end();
2929
});
30-
31-
});
30+
});

0 commit comments

Comments
 (0)