It might be worth writing a proxy object that throws an error if an attribute that was not set is accessed. This would be helpful for testing where I don't want to specify every attr, but still know when I'm not providing all necessary attrs for testing. E.g. const fakePuzzle = fakeObject<PuzzleManager>({ layers: ... }) will fail if any other (normally okay) attr of PuzzleManager is accessed during testing. I think there will be functions partialMockedObject and mockedObject. The first acts as described above, while the second requires all properties to be present, but not necessarily of the same type. Perhaps they can return both the untyped version of the object and a typed version of the object.
"no-param-reassign": ["warn", { props: true }], Requires controls to return props instead of assigning to the layer, and tempStorage to be handled differently.
I (might) need a linting rule for detecting access to event properties in an enclosed function. this is bad because the event can be modified before the inner function is called. (For vanilla event handlers)
Testing the interactions between control- and constraint-settings is going to be "fun" and will probably be an e2e test using puppeteer.
I need to change every use of a proxy state to be passed in as a function parameter instead of directly imported to prevent weird global state bugs in tests. Search import.*proxy to find every instance of where I do it incorrectly. Of course, the import will have to be done somewhere; I will probably only import them directly in React components; I can even inject them into PuzzleManager when instantiating it.
Import/Export allows for a great method of property-based testing. Some of the things to watch out for is things in overlay blits, grid origin offset changes...
Any advanced control scheme for gatherPoints() should have it where the points generated by gatherPoints can be reinterpreted as new events and give the same points by gatherPoints. In other words, gatherPoints should be idempotent. This is a great candidate for property based testing. It's really important for the idea of event replay (translate transform and undo/redo with answer/question control interactions).
I wonder if there is a way to require symbols to be named with strings Symbol("debug name")... That's less relavent now, but would be helpful if I use symbols more often.
const fakePuzzle = fakeObject<PuzzleManager>({ layers: ... })
will fail if any other (normally okay) attr of PuzzleManager is accessed during testing. I think there will be functionspartialMockedObject
andmockedObject
. The first acts as described above, while the second requires all properties to be present, but not necessarily of the same type. Perhaps they can return both the untyped version of the object and a typed version of the object."no-param-reassign": ["warn", { props: true }],
Requires controls to return props instead of assigning to the layer, and tempStorage to be handled differently.import.*proxy
to find every instance of where I do it incorrectly. Of course, the import will have to be done somewhere; I will probably only import them directly in React components; I can even inject them into PuzzleManager when instantiating it.gatherPoints()
should have it where the points generated by gatherPoints can be reinterpreted as new events and give the same points by gatherPoints. In other words, gatherPoints should be idempotent. This is a great candidate for property based testing. It's really important for the idea of event replay (translate transform and undo/redo with answer/question control interactions).Symbol("debug name")
... That's less relavent now, but would be helpful if I use symbols more often.