Replies: 3 comments
-
I think the second option is fine. However, for a complete test, it seems necessary to run the test on the js file. |
Beta Was this translation helpful? Give feedback.
0 replies
-
If only the import could be done dynamically, one test could be run on all builds. example: import { Vector as CjsVector } from 'dist/cjs/index';
import { Vector as UmdVector } from 'dist/umd/index';
import { Vector as IsolateCjsVector } from 'dist/isolate/cjs/index';
import { Vector as IsolateUmdVector } from 'dist/isolate/umd/index';
let Vector;
if (env.testPackage === 'cjs') {
Vector = CjsVector;
} else if (env.testPackage === 'umd') {
Vector = UmdVector;
} else if (env.testPackage === 'isolate-cjs') {
Vector = IsolateCjsVector;
} else if (env.testPackage === 'isolate-umd') {
Vector = IsolateUmdVector;
} else {
throw new Error('unknown package type');
}
describe('SequentialContainer test', () => {
it('Vector test', () => {
const myVector = new Vector([1], false);
//...
});
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
I need to research the practices of other open source projects to determine the plan. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Foreword
#85
We should find a good way to do test.
@noname0310
Possible solutions
This way will make test files so large.
I haven't found anyone doing like this.
The usual way is to test the source code directly.
And I suggest test for
ts
but notjs
.Such as
sdsl-cli
.This way will reduce the pressure on the repo.
But we cannot fully guarantee accuracy.
karma.config.ts
and make it test in building modeIt's a good idea but I don't know how feasible.
Beta Was this translation helpful? Give feedback.
All reactions