basic.spec.ts (754B)
1 export const description = ` 2 Basic unit tests for test framework. 3 `; 4 5 import { makeTestGroup } from '../common/framework/test_group.js'; 6 7 import { UnitTest } from './unit_test.js'; 8 9 export const g = makeTestGroup(UnitTest); 10 11 g.test('test,sync').fn(_t => {}); 12 13 g.test('test,async').fn(async _t => {}); 14 15 g.test('test_with_params,sync') 16 .paramsSimple([{}]) 17 .fn(t => { 18 t.debug(JSON.stringify(t.params)); 19 }); 20 21 g.test('test_with_params,async') 22 .paramsSimple([{}]) 23 .fn(t => { 24 t.debug(JSON.stringify(t.params)); 25 }); 26 27 g.test('test_with_params,private_params') 28 .paramsSimple([ 29 { a: 1, b: 2, _result: 3 }, // 30 { a: 4, b: -3, _result: 1 }, 31 ]) 32 .fn(t => { 33 const { a, b, _result } = t.params; 34 t.expect(a + b === _result); 35 });