Skip to content

Lint tests #81

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions dev.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { parseWsdl } from "./src/parser";

(async function () {
const d = await parseWsdl("./test/resources/strict/EVacSyncService_SPClient.wsdl", { modelNamePreffix: "", modelNameSuffix: "" });
})();
const d = await parseWsdl("./test/resources/strict/EVacSyncService_SPClient.wsdl", {
modelNamePreffix: "",
modelNameSuffix: "",
});
})();
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"dev": "ts-node -T ./dev.ts",
"dist": "tsc",
"build": "tsc",
"lint": "eslint ./src",
"lint:fix": "eslint --fix ./src"
"lint": "eslint '**/*.ts'",
"lint:fix": "eslint --fix '**/*.ts'"
},
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions test/node-soap/array_namespace_override.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { typecheck } from "../utils/tsc";

const target = "array_namespace_override.wsdl";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

t.test(`${target} - check definitions`, async t => {
t.test(`${target} - check definitions`, async (t) => {
t.equal(existsSync(`${outdir}/arraynamespaceoverride/definitions/Items.ts`), true);
t.equal(existsSync(`${outdir}/arraynamespaceoverride/definitions/Markdowns.ts`), true);
t.equal(existsSync(`${outdir}/arraynamespaceoverride/definitions/Order.ts`), true);
Expand All @@ -27,8 +27,8 @@ test(target, async t => {
t.end();
});

t.test(`${target} - compile`, async t => {
t.test(`${target} - compile`, async (t) => {
await typecheck(`${outdir}/arraynamespaceoverride/index.ts`);
t.end();
t.end();
});
});
});
13 changes: 6 additions & 7 deletions test/node-soap/attachments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@ import { typecheck } from "../utils/tsc";

const target = "attachments";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

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

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

t.end();
t.end();
});

});
});
13 changes: 6 additions & 7 deletions test/node-soap/binding-exception.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@ import { typecheck } from "../utils/tsc";

const target = "binding-exception";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

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

t.test(`${target} - compile`, async t => {
t.test(`${target} - compile`, async (t) => {
await typecheck(`${outdir}/bindingexception/index.ts`);
t.end();
t.end();
});

});
});
11 changes: 5 additions & 6 deletions test/node-soap/binding_document.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ import { typecheck } from "../utils/tsc";

const target = "binding_document";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

t.test(`${target} - compile`, async t => {
t.test(`${target} - compile`, async (t) => {
await typecheck(`${outdir}/bindingdocument/index.ts`);
t.end();
t.end();
});

});
});
12 changes: 5 additions & 7 deletions test/node-soap/builtin_types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,27 @@ import { typecheck } from "../utils/tsc";

const target = "builtin_types";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

t.test(`${target} - check definitions`, async t => {
t.test(`${target} - check definitions`, async (t) => {
t.equal(existsSync(`${outdir}/builtintypes/definitions/Xsduration.ts`), true);
t.equal(existsSync(`${outdir}/builtintypes/definitions/XsnonNegativeInteger.ts`), true);
t.equal(existsSync(`${outdir}/builtintypes/definitions/XsnonNegativeInteger1.ts`), true);
t.equal(existsSync(`${outdir}/builtintypes/definitions/Xsstring.ts`), true);
t.end();
});

t.test(`${target} - compile`, async t => {
t.test(`${target} - compile`, async (t) => {
await typecheck(`${outdir}/builtintypes/index.ts`);
t.end();
t.end();
});

});

11 changes: 5 additions & 6 deletions test/node-soap/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ import { typecheck } from "../utils/tsc";

const target = "Common";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

t.test(`${target} - compile`, async t => {
t.test(`${target} - compile`, async (t) => {
await typecheck(`${outdir}/common/index.ts`);
t.end();
t.end();
});

});
});
9 changes: 4 additions & 5 deletions test/node-soap/connection/econnrefused.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,19 @@ import { typecheck } from "../../utils/tsc";

const target = "connection/econnrefused";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

t.test(`${target} - generate wsdl client`, async t => {
t.test(`${target} - generate wsdl client`, async (t) => {
try {
await parseAndGenerate(input, outdir)
await parseAndGenerate(input, outdir);
t.fail("Should throw error ECONNREFUSED 127.0.0.1:1");
} catch (err) {
t.ok(err, "Got error");
}
t.end();
});

});
});
11 changes: 5 additions & 6 deletions test/node-soap/cross_schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { typecheck } from "../utils/tsc";

const target = "cross_schema";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

t.test(`${target} - check definitions`, async t => {
t.test(`${target} - check definitions`, async (t) => {
t.equal(existsSync(`${outdir}/crossschema/definitions/OperationResponse.ts`), true);
t.equal(existsSync(`${outdir}/crossschema/definitions/OperationReturn.ts`), true);
t.end();
Expand All @@ -26,7 +26,6 @@ test(target, async t => {
// TODO: Finish
// t.test(`${target} - compile`, async t => {
// await typecheck(`${outdir}/crossschema/index.ts`);
// t.end();
// t.end();
// });

});
});
13 changes: 6 additions & 7 deletions test/node-soap/default_namespace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,26 @@ import { typecheck } from "../utils/tsc";

const target = "default_namespace";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

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

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

t.end();
t.end();
});

});
});
13 changes: 6 additions & 7 deletions test/node-soap/default_namespace_schema_soap12.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@ import { typecheck } from "../utils/tsc";

const target = "default_namespace_soap12";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

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

t.test(`${target} - compile`, async t => {
t.test(`${target} - compile`, async (t) => {
await typecheck(`${outdir}/defaultnamespacesoap12/index.ts`);
t.end();
t.end();
});

});
});
13 changes: 6 additions & 7 deletions test/node-soap/dummy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,27 @@ import { typecheck } from "../utils/tsc";

const target = "Dummy";

test(target, async t => {
test(target, async (t) => {
Logger.disabled();

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

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

t.test(`${target} - check definitions`, async t => {
t.test(`${target} - check definitions`, async (t) => {
t.equal(existsSync(`${outdir}/dummy/definitions/DummyList.ts`), true);
t.equal(existsSync(`${outdir}/dummy/definitions/DummyRequest.ts`), true);
t.equal(existsSync(`${outdir}/dummy/definitions/DummyResponse.ts`), true);
t.equal(existsSync(`${outdir}/dummy/definitions/DummyResult.ts`), true);
t.end();
});

t.test(`${target} - compile`, async t => {
t.test(`${target} - compile`, async (t) => {
await typecheck(`${outdir}/dummy/index.ts`);
t.end();
t.end();
});

});
});
Loading