Skip to content

Commit

Permalink
Update CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
captbaritone committed Mar 26, 2024
1 parent f6daf11 commit f9e7d76
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -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.

```
Expand Down
6 changes: 3 additions & 3 deletions src/Extractor.ts
Expand Up @@ -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: {
Expand Down

0 comments on commit f9e7d76

Please sign in to comment.