Skip to content

Commit

Permalink
fix(assert): normalize windows newlines for snapshot & fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeed committed Jun 4, 2021
1 parent b84c0a4 commit 2ec6735
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/assert.js
Expand Up @@ -2,6 +2,7 @@ import { dequal } from 'dequal';
import { compare, lines } from 'uvu/diff';

function dedent(str) {
str = str.replace(/\r?\n/g, '\n');
let arr = str.match(/^[ \t]*(?=\S)/gm);
let i = 0, min = 1/0, len = (arr||[]).length;
for (; i < len; i++) min = Math.min(min, arr[i].length);
Expand Down

0 comments on commit 2ec6735

Please sign in to comment.