Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partially fixes #1330
Settings:
jest
and supporting packages (babel-jest
, etc.)canvas
.package.json
to execute all.test.js
files using Jest.env: { jest: true }
in.eslint.js
to fix es-lint errors re: undefined variablejest
.testEnvironmentOptions: { resources: "usable" }
to Jest config so that images will call theonload
function.setupTests.js
file in order to load thetfjs-node
backend.ImageData
here, but it doesn't seem to work.Utilities:
asyncLoadImage
andrandomImageData
instead of repeating code in multiple test files.polyfillImageData
function which can be used in abeforeAll
function.Test Modifications:
ml5
variable.const { charRNN } = ml5;
toimport charRNN from './index';
.tf
directly from@tensorflow/tfjs
inNeuralNetwork
instead of usingml5.tf
alias.jasmine.DEFAULT_TIMEOUT_INTERVAL = n;
withjest.setTimeout(n);
.spyOn
withjest.spyOn
(which internally calls the jasminespyOn
function)..and.callFake
to.mockImplementation
,.and.returnValue
to.mockReturnValue
, etc.Migrated Tests:
The 57 skipped tests are all
xdescribe
placeholders in theNeuralNetwork
file.