Skip to content

Commit

Permalink
test: Move cli e2e test to typegate/tests/e2e (#492)
Browse files Browse the repository at this point in the history
<!--
Pull requests are squash merged using:
- their title as the commit message
- their description as the commit body

Having a good title and description is important for the users to get
readable changelog and understand when they need to update his code and
how.
-->

### Describe your change

Move CLI e2e tests to typegate/tests/e2e

### Motivation and context

[MET-208](https://metatype.atlassian.net/browse/MET-208)


### Checklist

- [x] The change come with new or modified tests
- [x] Hard-to-understand functions have explanatory comments
- [x] End-user documentation is updated to reflect the change

---------

Co-authored-by: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com>
  • Loading branch information
Natoandro and Yohe-Am committed Nov 22, 2023
1 parent b5308a2 commit 5ad95df
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 58 deletions.
6 changes: 0 additions & 6 deletions meta-cli/tests/e2e.rs

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions meta-cli/tests/e2e/validator.rs

This file was deleted.

File renamed without changes.
22 changes: 22 additions & 0 deletions typegate/tests/e2e/typegraph/validator_test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright Metatype OÜ, licensed under the Elastic License 2.0.
// SPDX-License-Identifier: Elastic-2.0

import { TestModule } from "test-utils/test_module.ts";
import { Meta } from "test-utils/mod.ts";
import { assert } from "std/assert/mod.ts";

const m = new TestModule(import.meta);

Meta.test("typegraph validation", async (t) => {
await t.should(
"fail to serialize typegraph with invalid injection",
async () => {
try {
await m.cli({}, "serialize", "-f", "typegraphs/python/validator.py");
assert(false, "should have thrown");
} catch (e) {
await t.assertSnapshot(e.message);
}
},
);
});

0 comments on commit 5ad95df

Please sign in to comment.