MTG / essentia.js

JavaScript library for music/audio analysis and processing powered by Essentia WebAssembly
https://essentia.upf.edu/essentiajs
GNU Affero General Public License v3.0
628 stars 41 forks source link

Write integration tests #66

Open jmarcosfer opened 2 years ago

jmarcosfer commented 2 years ago

Description

Add integration tests for the library's algorithms. Assume that the upstream Essentia, from which Essentia.js is built, is already tested. Thus, these integration tests should check that the JS part (wrapper) is working correctly.

However, this could include unit tests as a prior step, to ensure that the Emscripten transpilation process (c++ –> WASM) doesn't negatively affect algorithms' output or render some of them unusable.

How?

Consider creating basic unit tests as a prior step to compare JS algorithm outputs to Python algorithm outputs as a kind of regression testing. These tests could be generated automatically from code_generator.py, then the results saved to file for comparison with another smaller script.

Do this first set of tests on Node.js E. g. https://github.com/avajs/ava

Types

Most of these test should probably ensure one of two things:

For reference, these are the types in included algorithms: param types: ['integer', 'real', 'string', 'vector_real', 'bool'] input types: ['vector_real', 'real', 'vector_vector_real', 'vector_string', 'string'] output types: ['real', 'vector_real', 'vector_vector_real', 'integer', 'string', 'vector_string'] So tests should consider cases for these types (as param, input, and output types).