Skip to content

Commit

Permalink
test: fix travis test
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed May 17, 2019
1 parent 503d128 commit c48a012
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"cli-boxes": "^2.2.0",
"i": "^0.3.6",
"lodash": "^4.17.11",
"npm": "^6.9.0"
"npm": "^6.9.0",
"strip-ansi": "^5.2.0"
},
"description": "Generates a coordinate grid (CLI square grid).",
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion test/square-grid/utilities/drawCoordinateGrid.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// @flow

import test from 'ava';
import stripAnsi from 'strip-ansi';
import createCoordinateGridMember from '../../../src/factories/createCoordinateGridMember';
import drawCoordinateGrid from '../../../src/utilities/drawCoordinateGrid';
import drawSquare from '../../../src/utilities/drawSquare';
Expand Down Expand Up @@ -50,7 +51,7 @@ test('draws README example (boxes)', (t) => {
createCoordinateGridMember(2, 2, drawSquare('C3', 'single', 'red'))
]);

t.is(coordinateGrid, '┌────┐╔════╗ \n│ A1 │║ A2 ║ A3 \n└────┘╚════╝ \n \u001b[32m┌────┐\u001b[39m \n \u001b[32m│ B2 │\u001b[39m \n \u001b[32m└────┘\u001b[39m \n ┌────┐\u001b[31m┌────┐\u001b[39m\n │ C2 │\u001b[31m│ C3 │\u001b[39m\n └────┘\u001b[31m└────┘\u001b[39m');
t.is(stripAnsi(coordinateGrid), '┌────┐╔════╗ \n│ A1 │║ A2 ║ A3 \n└────┘╚════╝ \n ┌────┐ \n │ B2 │ \n └────┘ \n ┌────┐┌────┐\n │ C2 ││ C3 │\n └────┘└────┘');
});

test('draws README example (single character)', (t) => {
Expand Down

0 comments on commit c48a012

Please sign in to comment.