@emdaer/plugin-table
Advanced tools
| const table = require('../src'); | ||
| describe('@emdaer/plugin-table', () => { | ||
| test('generates tables with headers', async () => { | ||
| expect(await table({ headers: ['A', 'B', 'C'] })).toBe( | ||
| '<table><tr><th>A</th><th>B</th><th>C</th></tr></table>' | ||
| ); | ||
| }); | ||
| test('generates tables with rows', async () => { | ||
| expect(await table({ rows: [[1, 2, 3], [2, 3, 4], [3, 4, 5]] })).toBe( | ||
| '<table><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>2</td><td>3</td><td>4</td></tr><tr><td>3</td><td>4</td><td>5</td></tr></table>' | ||
| ); | ||
| }); | ||
| test('generates tables with headers and rows', async () => { | ||
| expect( | ||
| await table({ | ||
| headers: ['A', 'B', 'C'], | ||
| rows: [[1, 2, 3], [2, 3, 4], [3, 4, 5]], | ||
| }) | ||
| ).toBe( | ||
| '<table><tr><th>A</th><th>B</th><th>C</th></tr><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>2</td><td>3</td><td>4</td></tr><tr><td>3</td><td>4</td><td>5</td></tr></table>' | ||
| ); | ||
| }); | ||
| test('generates tables without headers or rows', async () => { | ||
| expect(await table({})).toBe('<table></table>'); | ||
| }); | ||
| }); |
+3
-7
| { | ||
| "name": "@emdaer/plugin-table", | ||
| "description": "an emdaer plugin to generate tables", | ||
| "version": "1.0.0-alpha.13", | ||
| "version": "1.0.0-beta.0", | ||
| "repository": "emdaer/emdaer", | ||
| "homepage": "https://emdaer.github.io/", | ||
| "homepage": "https://emdaer.me/", | ||
| "keywords": [ | ||
@@ -13,8 +13,4 @@ "emdaer-plugin" | ||
| "scripts": { | ||
| "write-docs": "emdaer && git add ./README.md", | ||
| "prepublish": "flow-remove-types -p src -d lib && npm run write-docs" | ||
| "prepublish": "flow-remove-types -p src -i .test.js -d lib" | ||
| }, | ||
| "devDependencies": { | ||
| "flow-remove-types": "1.2.1" | ||
| }, | ||
| "publishConfig": { | ||
@@ -21,0 +17,0 @@ "access": "public" |
| const table = require('../src'); | ||
| describe('@emdaer/plugin-table', () => { | ||
| test('generates tables with headers', async () => { | ||
| expect(await table({ headers: ['A', 'B', 'C'] })).toBe( | ||
| '<table><tr><th>A</th><th>B</th><th>C</th></tr></table>' | ||
| ); | ||
| }); | ||
| test('generates tables with rows', async () => { | ||
| expect(await table({ rows: [[1, 2, 3], [2, 3, 4], [3, 4, 5]] })).toBe( | ||
| '<table><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>2</td><td>3</td><td>4</td></tr><tr><td>3</td><td>4</td><td>5</td></tr></table>' | ||
| ); | ||
| }); | ||
| test('generates tables with headers and rows', async () => { | ||
| expect( | ||
| await table({ | ||
| headers: ['A', 'B', 'C'], | ||
| rows: [[1, 2, 3], [2, 3, 4], [3, 4, 5]], | ||
| }) | ||
| ).toBe( | ||
| '<table><tr><th>A</th><th>B</th><th>C</th></tr><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>2</td><td>3</td><td>4</td></tr><tr><td>3</td><td>4</td><td>5</td></tr></table>' | ||
| ); | ||
| }); | ||
| test('generates tables without headers or rows', async () => { | ||
| expect(await table({})).toBe('<table></table>'); | ||
| }); | ||
| }); |
-17
| destination: ./README.md | ||
| content: | ||
| - - heading | ||
| - | ||
| level: 1 | ||
| from: | ||
| - value-from-package | ||
| - | ||
| value: name | ||
| - - paragraph | ||
| - | ||
| from: | ||
| - value-from-package | ||
| - | ||
| value: description | ||
| transforms: | ||
| - - smartypants |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
-100%0
-100%3153
-11.38%5
-16.67%