c.spec.ts (1703B)
1 export const description = 'Description for c.spec.ts'; 2 3 import { makeTestGroup } from '../../../common/framework/test_group.js'; 4 import { unreachable } from '../../../common/util/util.js'; 5 import { UnitTest } from '../../../unittests/unit_test.js'; 6 7 export const g = makeTestGroup(UnitTest); 8 9 g.test('f') 10 .desc( 11 `Test plan for f 12 - Test stuff 13 - Test some more stuff` 14 ) 15 .fn(() => {}); 16 17 g.test('f,g').fn(() => {}); 18 19 g.test('f,g,h') 20 .paramsSimple([{}, { x: 0 }, { x: 0, y: 0 }]) 21 .fn(() => {}); 22 23 g.test('case_depth_2_in_single_child_test') 24 .paramsSimple([{ x: 0, y: 0 }]) 25 .fn(() => {}); 26 27 g.test('deep_case_tree') 28 .params(u => 29 u // 30 .combine('x', [1, 2]) 31 .combine('y', [1, 2]) 32 .combine('z', [1, 2]) 33 ) 34 .fn(() => {}); 35 36 g.test('statuses,debug').fn(t => { 37 t.debug('debug'); 38 }); 39 40 g.test('statuses,skip').fn(t => { 41 t.skip('skip'); 42 }); 43 44 g.test('statuses,warn').fn(t => { 45 t.warn('warn'); 46 }); 47 48 g.test('statuses,fail').fn(t => { 49 t.fail('fail'); 50 }); 51 52 g.test('statuses,throw').fn(() => { 53 unreachable('unreachable'); 54 }); 55 56 g.test('multiple_same_stack').fn(t => { 57 for (let i = 0; i < 3; ++i) { 58 t.fail( 59 i === 2 60 ? 'this should appear after deduplicated line' 61 : 'this should be "seen 2 times with identical stack"' 62 ); 63 } 64 }); 65 66 g.test('multiple_same_level').fn(t => { 67 t.fail('this should print a stack'); 68 t.fail('this should print a stack'); 69 t.fail('this should not print a stack'); 70 }); 71 72 g.test('lower_levels_hidden,before').fn(t => { 73 t.warn('warn - this should not print a stack'); 74 t.fail('fail'); 75 }); 76 77 g.test('lower_levels_hidden,after').fn(t => { 78 t.fail('fail'); 79 t.warn('warn - this should not print a stack'); 80 });