Smalruby3 GUI is a set of React components that comprise the interface for creating and running Smalruby 3.0 projects. It forked from LLK/scratch-gui .
This requires you to have Git and Node.js installed.
In your own node environment/application:
npm install https://github.com/smalruby/smalruby3-gui.git
If you want to edit/play yourself:
git clone https://github.com/smalruby/smarluby3-gui.git
cd smarluby3-gui
npm install
Running the project requires Node.js to be installed.
Open a Command Prompt or Terminal in the repository and run:
npm start
Then go to http://localhost:8601/ - the playground outputs the default GUI component
You may want to review the documentation for Jest and Enzyme as you write your tests.
See jest cli docs for more options.
NOTE: If you're a windows user, please run these scripts in Windows cmd.exe
instead of Git Bash/MINGW64.
Before running any test, make sure you have run npm install
from this (scratch-gui) repository's top level.
To run linter, unit tests, build, and integration tests, all at once:
npm test
To run unit tests in isolation:
npm run test:unit
To run unit tests in watch mode (watches for code changes and continuously runs tests):
npm run test:unit -- --watch
You can run a single file of integration tests (in this example, the button
tests):
$(npm bin)/jest --runInBand test/unit/components/button.test.jsx
Integration tests use a headless browser to manipulate the actual html and javascript that the repo produces. You will not see this activity (though you can hear it when sounds are played!).
Note that integration tests require you to first create a build that can be loaded in a browser:
npm run build
Then, you can run all integration tests:
npm run test:integration
Or, you can run a single file of integration tests (in this example, the backpack
tests):
$(npm bin)/jest --runInBand test/integration/backpack.test.js
If you want to watch the browser as it runs the test, rather than running headless, use:
USE_HEADLESS=no $(npm bin)/jest --runInBand test/integration/backpack.test.js
see Scratch's document: Read the wiki for a step-by-step guide.