-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a test to verify the CommonJS build
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const Tom = require('@test-runner/tom') | ||
const Table = require('table-layout') | ||
const assert = require('assert') | ||
const a = assert.strict | ||
|
||
const eol = '\n' | ||
const tom = new Tom() | ||
|
||
tom.test('new Table()', function () { | ||
const options = { | ||
maxWidth: 40, | ||
padding: { left: '<', right: '>' } | ||
} | ||
const data = [ | ||
{ one: 'row 1 column one .. .. ..', two: 'r1 c2' }, | ||
{ one: 'r2 c1', two: 'row two column 2' } | ||
] | ||
const table = new Table(data, options) | ||
|
||
a.equal(table.rows.list.length, 2) | ||
a.equal(table.columns.list.length, 2) | ||
}) | ||
|
||
module.exports = tom |