mirror of
https://github.com/thangisme/notes.git
synced 2025-11-23 13:12:25 -05:00
Initial commit
This commit is contained in:
35
node_modules/table/test/README/usage/column_width.js
generated
vendored
Normal file
35
node_modules/table/test/README/usage/column_width.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
import {
|
||||
table
|
||||
} from './../../../src';
|
||||
import expectTable from './expectTable';
|
||||
|
||||
describe('README.md usage/', () => {
|
||||
it('column_width', () => {
|
||||
const data = [
|
||||
['0A', '0B', '0C'],
|
||||
['1A', '1B', '1C'],
|
||||
['2A', '2B', '2C']
|
||||
];
|
||||
|
||||
const config = {
|
||||
columns: {
|
||||
1: {
|
||||
width: 10
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const output = table(data, config);
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
expectTable(output, `
|
||||
╔════╤════════════╤════╗
|
||||
║ 0A │ 0B │ 0C ║
|
||||
╟────┼────────────┼────╢
|
||||
║ 1A │ 1B │ 1C ║
|
||||
╟────┼────────────┼────╢
|
||||
║ 2A │ 2B │ 2C ║
|
||||
╚════╧════════════╧════╝
|
||||
`);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user