npm install
Build the plugin:
npm run build:plugin
Run all tests:
npm run test
Run all tests with coverage:
npm run coverage
To add more tests for createDiagram(...)
, which returns an Expression Tutor diagram
given a Scratch block and the thread that was used to evaluate the block,
run the chrome extension on a Scratch project, and click on the 'e' button on the block to test.
Make sure update the condition in diagramUtils.js
to process.env.NODE_ENV
instead of process.env.NODE_ENV === testing
.
There will be 4 strings in the console after the click:
- stringified version of the block
- stringified version of the thread without the private
_cache
attribute - stringified version of object with the
_cache
- stringified version of diagram produced
Replace everything in the blockContainer
attribute in (2) with (3).
The new thread object should be used as the second argument.
The first argument is (1).
The expected is (4).
- Build both the bundle and the plugin;
- Open Chrome;
- Go to the following URI:
chrome://extensions/
; - Make sure that
Developer mode
is active (top-right of the page); - Press
load unpacked
; - Browse to the location of this plugin and select the
build
directory;
When you open a Scratch project you will see the Chrome Plugin tooltip!
- Alen Sugimoto
- Andrea Gallidabino