0.2.21 • Published 3 years ago

s.starterapptests v0.2.21

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

Sabio React Testing

Node module for testing React for Sabio students

Installation Instructions

React App

  • For this package, the dependency s.starterapptests exists in the repositories. This is included in React-start-here, React-componentize, and React-routing
  • In order for the tests to run properly, ensure the following node modules are installed:
@babel/plugin-syntax-jsx
@wojtekmaj/enzyme-adapter-react-17
enzyme
enzyme-to-json
jest-html-reporter

Package.json scripts

  • Ensure the following "scripts" are inside package.json:
"copy-test": "copy-test",
"test-forms-assessment": "set CI=true &&react-scripts test -i src/__tests__/_assessments/React-Form-1.test.js --env=jsdom --testResultsProcessor=./node_modules/jest-html-reporter"
"compile-test": "react-scripts test -i src/__tests__/_assessments/React-Form-1.test.js --watchAll=false --json > src/__tests__/results.json &",
"submit-test": "submit-test"
  • copy-test copies the tests from the node module into the src/__tests__ directory. By default, this is hidden from the students.
  • test-basics will run the test and generate a new html report in test-report. They can open this html document in live server. Students will need to run this script every time to get a new update on their bugs.
  • compile-test exports the current results of the jest and write it to a new file, located at src/__tests__/results.json. This should be run only when preparing to submit. By default this will be hidden from the students.
  • submit-test submits the test to our database. Students will need to have their git username setup in order for this to work.

Babel config file

  • A file should exist in the root directory named babel.config.js. If it does not, ensure it exists. It may be hidden from the students in VS Code.
  • The file should contain the following:
module.exports = {
  presets: ["@babel/preset-env", "@babel/preset-react"],
};

Testing module (for development purposes only)

  • In the directory of the node module, run yarn link in the terminal. Should receive a success as an output in terminal.

  • In the directory of the react app, run yarn link s.starterapptests in the terminal. A link will be created and the packgage will be installed in the node_modules directory. As you edit the node module, the module in the react app will update in real time.

  • In react app, run yarn run react-test to start module.

0.2.21

3 years ago

0.2.20

3 years ago

0.2.19

3 years ago

0.2.18

3 years ago

0.2.17

3 years ago

0.1.41

3 years ago

0.2.16

3 years ago

0.2.15

3 years ago

0.2.14

3 years ago

0.2.13

3 years ago

0.2.11

3 years ago

0.1.38

3 years ago

0.1.39

3 years ago

0.1.4

3 years ago

0.1.32

3 years ago

0.1.33

3 years ago

0.1.34

3 years ago

0.1.35

3 years ago

0.1.36

3 years ago

0.1.37

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.31

3 years ago

0.1.27

3 years ago

0.1.21

3 years ago

0.1.22

3 years ago

0.1.23

3 years ago

0.1.24

3 years ago

0.1.25

3 years ago

0.1.26

3 years ago

0.1.3

3 years ago

0.0.33

3 years ago

0.0.34

3 years ago

0.0.35

3 years ago

0.1.0

3 years ago

0.1.2

3 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.26

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago