forked from jeremydaly/lambda-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprettyPrint.js
More file actions
20 lines (14 loc) · 1.95 KB
/
Copy pathprettyPrint.js
File metadata and controls
20 lines (14 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
'use strict';
const expect = require('chai').expect // Assertion library
const prettyPrint = require('../lib/prettyPrint')
/******************************************************************************/
/*** BEGIN TESTS ***/
/******************************************************************************/
describe('PrettyPrint Tests:', function() {
it('Minimum header widths', function() {
expect(prettyPrint([['GET','/'],['POST','/'],['DELETE','/']])).to.equal('╔══════════╤═════════╗\n║ \u001b[1mMETHOD\u001b[0m │ \u001b[1mROUTE\u001b[0m ║\n╟──────────┼─────────╢\n║ GET │ / ║\n╟──────────┼─────────╢\n║ POST │ / ║\n╟──────────┼─────────╢\n║ DELETE │ / ║\n╚══════════╧═════════╝')
}) // end it
it('Adjusted header widths', function() {
expect(prettyPrint([['GET','/'],['POST','/testing'],['DELETE','/long-url-path-name']])).to.equal('╔══════════╤═══════════════════════╗\n║ \u001b[1mMETHOD\u001b[0m │ \u001b[1mROUTE \u001b[0m ║\n╟──────────┼───────────────────────╢\n║ GET │ / ║\n╟──────────┼───────────────────────╢\n║ POST │ /testing ║\n╟──────────┼───────────────────────╢\n║ DELETE │ /long-url-path-name ║\n╚══════════╧═══════════════════════╝')
}) // end it
}) // end UTILITY tests