Skip to content

Commit f69af75

Browse files
committed
Added note about custom matcher in dev documentation
1 parent 77d7e8f commit f69af75

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
# Testing Documentation and Guidelines
22

3+
## Custom matchers
4+
5+
We have added some custom matchers to ease the testing. You can see the full list at `test/setup.ts`, in
6+
the `expect.extend` part.
7+
8+
* `expect(A).toEqualGraph(B)`: Use this matcher to check whether graphs A and B are equal (meaning containing the
9+
same set of triples)
10+
* `expect(A).toContainGraph(B)`: Use this matcher to check whether graph B is contained in graph A
11+
312
## Notes
413

5-
The original code was not written with testing in mind. In order to make testing more efficient you may find it easier to export a function. To do this include the following comment above the function so that it does not get picked up by Typedoc.
14+
The original code was not written with testing in mind. In order to make testing more efficient you may find it
15+
easier to export a function. To do this include the following comment above the function so that it does not
16+
get picked up by Typedoc.
617
`@ignore exporting this only for the unit test`
718

8-
There will also be times that even exporting the function isn't enough to enable proper tests to be developed. In this case follow the commenting procedures in the Code Readme.md, which is to add the comment
19+
There will also be times that even exporting the function isn't enough to enable proper tests to be developed.
20+
In this case follow the commenting procedures in the Code Readme.md, which is to add the comment
921
` \* @@ TODO and desribe the problem.
1022

11-
You can reference https://github.com/solid/solid-ui/issues/215 in your TODO comment if the code is hard to test due to DOM manipulation.
23+
You can reference https://github.com/solid/solid-ui/issues/215 in your TODO comment if the code is hard to
24+
test due to DOM manipulation.

0 commit comments

Comments
 (0)