Skip to content

Commit 357df55

Browse files
committed
support todo
1 parent 82b565d commit 357df55

File tree

6 files changed

+39
-16
lines changed

6 files changed

+39
-16
lines changed

dist/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,13 @@ class DefaultView {
431431
}
432432
}
433433

434+
testTodo (test) {
435+
if (!this.options.viewHideSkips) {
436+
const parent = test.parent ? test.parent.name : '';
437+
this.log(`[cyan]{-} [cyan]{${parent}} [cyan]{${test.name}}`);
438+
}
439+
}
440+
434441
testIgnore (test) {}
435442

436443
/**

dist/index.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,13 @@ class DefaultView {
410410
}
411411
}
412412

413+
testTodo (test) {
414+
if (!this.options.viewHideSkips) {
415+
const parent = test.parent ? test.parent.name : '';
416+
this.log(`[cyan]{-} [cyan]{${parent}} [cyan]{${test.name}}`);
417+
}
418+
}
419+
413420
testIgnore (test) {}
414421

415422
/**

index.mjs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,13 @@ class DefaultView {
9191
}
9292
}
9393

94+
testTodo (test) {
95+
if (!this.options.viewHideSkips) {
96+
const parent = test.parent ? test.parent.name : '';
97+
this.log(`[cyan]{-} [cyan]{${parent}} [cyan]{${test.name}}`);
98+
}
99+
}
100+
94101
testIgnore (test) {}
95102

96103
/**

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
"ansi-escape-sequences": "^5.1.2"
2525
},
2626
"devDependencies": {
27-
"rollup": "^1.27.6",
28-
"test-object-model": "^0.5.7"
27+
"rollup": "^1.27.8",
28+
"test-object-model": "^0.5.10"
2929
},
3030
"files": [
3131
"index.mjs",

test.mjs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Tom from 'test-object-model'
33

44
const defaultView = new DefaultView({ viewShowStarts: true })
55

6-
{
6+
{ /* main report */
77
async function start () {
88
await defaultView.init()
99
console.log('Main report:')
@@ -22,15 +22,17 @@ const defaultView = new DefaultView({ viewShowStarts: true })
2222
} catch (err) {
2323
defaultView.testFail(test3, test3.result)
2424
}
25+
26+
const todo = parent.todo('a todo')
27+
defaultView.testTodo(todo)
2528
}
2629

2730
start().catch(console.error)
2831
}
2932

30-
{
33+
{ /* context data: pass */
3134
async function start () {
3235
await defaultView.init()
33-
console.log('In-test data:')
3436
const test = new Tom('test 1', function () {
3537
this.data = {
3638
something: 'one',
@@ -44,7 +46,7 @@ const defaultView = new DefaultView({ viewShowStarts: true })
4446
start().catch(console.error)
4547
}
4648

47-
{
49+
{ /* context data: fail */
4850
async function start () {
4951
await defaultView.init()
5052
const test = new Tom('test 2', function () {

0 commit comments

Comments
 (0)