Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test file for Synthutils.js added #4199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justin212407
Copy link
Contributor

@justin212407 justin212407 commented Dec 28, 2024

Description:

This pull request addresses issue #4124 for including test files.

Changes Made:

The test file for synthutils.js has been added through this pull request. It addresses all the functions present in the synthutils.js file.

Screenshots:

Screenshot 2024-12-28 204056

Screenshot 2024-12-28 204110

Checklist:

  • My changes adhere to the project's contribution guidelines.
  • Code changes are implemented.
  • The test written passes all the checks.

@justin212407
Copy link
Contributor Author

@walterbender please review this as the babel.config.js will be needed to write some other tests too.

@walterbender
Copy link
Member

I am seeing:
` FAIL js/utils/tests/synthutils.test.js
● Test suite failed to run

Cannot find module 'tone' from 'js/utils/__tests__/synthutils.test.js'

  4 | import Synth from '../synthutils';
  5 |
> 6 | jest.mock('tone', () => ({
    |      ^
  7 |   Transport: {
  8 |     start: jest.fn(),
  9 |     stop: jest.fn()

  at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:427:11)
  at Object.mock (js/utils/__tests__/synthutils.test.js:6:6)

(node:505714) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ... to show where the warning was created)
`

@justin212407
Copy link
Contributor Author

@walterbender you need to install tone.js locally for it to run. That's probably why you are facing those errors as the synthutilsjs file uses tone.js for testing.

@justin212407
Copy link
Contributor Author

justin212407 commented Dec 29, 2024

Just checked it again by running the test locally, it runs successfully when i run it that way
Screenshot 2024-12-30 021922

@walterbender
Copy link
Member

Isn't tone.js already installed as part of MB? Or does it need to be installed as an NPM package as well?

@justin212407
Copy link
Contributor Author

@walterbender it needs to be installed as an NPM package using npm install tone.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants