Closed sbrin closed 1 year ago
To have BitBuilder create a Pull Request with the implementation, the user who created the issue (@sbrin) can comment below with "LGTM".
npm install --save-dev jest
to install Jest. Also, install babel-jest
and @babel/preset-env
for transpiling our code for Jest with npm install --save-dev babel-jest @babel/preset-env
. Create a .babelrc
file in the root directory and add { "presets": ["@babel/preset-env"] }
to it. This will ensure that our ES6 code is transpiled correctly for Jest.tests
directory named utils.test.js
. This file will contain all of our unit tests for the functions in utils.js
.utils.test.js
file, write a test for the bline
function. This function takes in several parameters and manipulates an image data object. To test this function, you will need to create a mock image data object and pass it to the function along with other parameters. Then, assert that the image data object has been manipulated as expected.utils.test.js
file, write a test for the drawCircle
function. This function takes in several parameters and manipulates an image data object. To test this function, you will need to create a mock image data object and pass it to the function along with other parameters. Then, assert that the image data object has been manipulated as expected.utils.test.js
file, write a test for the drawDisc
function. This function takes in several parameters and manipulates an image data object. To test this function, you will need to create a mock image data object and pass it to the function along with other parameters. Then, assert that the image data object has been manipulated as expected.utils.test.js
file, write a test for the maskBlack
function. This function takes in several parameters and manipulates an image data object. To test this function, you will need to create a mock image data object and pass it to the function along with other parameters. Then, assert that the image data object has been manipulated as expected.Generated with :heart: by www.bitbuilder.ai. Questions? Check out our the documentation.
LGTM
Write unit tests with jest for all ./js/utils.js functions