From f9e7d76f9cfa410c4b335d45b46f7564955f96e9 Mon Sep 17 00:00:00 2001 From: Jordan Eldredge Date: Tue, 26 Mar 2024 13:10:48 -0700 Subject: [PATCH] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- src/Extractor.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35c892d3..0b0dca49 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,13 +11,13 @@ case and compare the output to corresponding `.expected.ts` file. If the output does not match the expected output, the test runner will fail. The tests in `src/tests/fixtures` are unit tests that test the behavior of the -extraction. They extract GraphQL SDL from the file and write that as output. +extraction and code generation. They extract GraphQL SDL, generated `schema.ts` or any associated errors and code actions from the file and write that as output. If the test includes a line like `// Locate: User.name` of `// Locate: SomeType` then the test runner will instead locate the given entity and write the location as output. -The tests in `src/tests/integrationFixtures` are integration tests that test the _runtime_ behavior of the tool. They expect each file to be a `.ts` file with `@gql` docblock tags which exports a root query class as the named export `Query` and a GraphQL query text under the named export `query`. The test runner will execute the query against the root query class and emit the returned response JSON as the test output. +The tests in `src/tests/integrationFixtures` are integration tests that test the _runtime_ behavior of the generated code. Each directory contains an `index.ts` file with `@gql` docblock tags which exports a root query class as the named export `Query` and a GraphQL query text under the named export `query`. The test runner will execute the query against the root query class and emit the returned response JSON as the test output. ``` diff --git a/src/Extractor.ts b/src/Extractor.ts index fa9d4eed..f9426209 100644 --- a/src/Extractor.ts +++ b/src/Extractor.ts @@ -212,10 +212,10 @@ class Extractor { ts.isClassDeclaration(node) ) ) { - console.log("node kind", node.kind); - return this.report(node, E.contextTagOnWrongNode()); + this.report(node, E.contextTagOnWrongNode()); + } else { + this.contextDefinitions.push(node); } - this.contextDefinitions.push(node); break; } case KILLS_PARENT_ON_EXCEPTION_TAG: {