Commit 6e908fbe authored by Linshizhi's avatar Linshizhi

Add UnitTests

parents
Pipeline #17750 failed with stages
{
"name": "paraencode",
"version": "1.0.0",
"description": "Encode frames into a video",
"main": "src/paraEncode.js",
"scripts": {
"test": "npx jasmine-browser-runner runSpecs"
},
"author": "",
"license": "ISC",
"dependencies": {
"rxjs": "^7.5.5"
},
"devDependencies": {
"jasmine-browser-runner": "^1.0.0",
"jasmine-core": "^4.1.0"
}
}
describe("A suite", function() {
it("contain spec with an expectation", function() {
expect(true).toBe(true);
});
});
{
"srcDir": "src",
"srcFiles": [
"**/*.js"
],
"specDir": "spec",
"specFiles": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
],
"env": {
"stopSpecOnExpectationFailure": false,
"stopOnSpecFailure": false,
"random": true
},
"browser": {
"name": "firefox"
}
}
\ No newline at end of file
import { assert } from 'utils.js';
export let SUPPORT_CODECS = {
"h264": 0
};
export class ParaEncoder {
/* */
constructor(numOfTR, codec) {
assert(typeof(numOfTR) == 'number');
assert(typeof(codec) == 'string');
this.numOfTR = numOfTR;
this.codec = codec;
}
}
export function assert(expr, message) {
if (!expr) {
throw message || "Assertion failed";
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment