Skip to content

Commit

Permalink
Re-add regexEqual tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martpie committed Nov 10, 2020
1 parent b0b6428 commit af7c63e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/__tests__/helpers.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const rewire = require('rewire');
const anymatch = require('anymatch');

const withTmRewire = rewire('../next-transpile-modules');

const regexEqual = withTmRewire.__get__('regexEqual');

describe('regexEqual', () => {
// Cannot test because of Jest https://github.com/facebook/jest/issues/2549
// test('should return true if two regexps are similar', () => {
// expect(regexEqual(/a/, /a/)).toBe(true);
// expect(regexEqual(/a/gi, /a/ig)).toBe(true);
// });

test('should return false if two regexps are different', () => {
expect(regexEqual(/a/, /[\\/]a[\\/]/)).toBe(false);
});
});

0 comments on commit af7c63e

Please sign in to comment.