Skip to content

Commit

Permalink
Add test for ccampbell#208
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaswerkmeister committed Jul 26, 2017
1 parent 668348f commit 0454b0c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/rainbow-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const patternB = [{
pattern: /is/gi
}];

const patternDollar = [{
name: 'dollar',
pattern: /'\$'/g
}];

////////////////
// Test suite //
////////////////
Expand Down Expand Up @@ -113,4 +118,13 @@ describe('Rainbow', () => {
done();
});
});

it('Should support dollar signs in replacements', (done) => {
Rainbow.extend('dollarLanguage', patternDollar);

Rainbow.color('here is a test with a \'$\' sign in it', 'dollarLanguage', (result) => {
expect(result).to.equal('here is a test with a <span class="dollar">\'$\'</span> sign in it');
done();
});
});
});

0 comments on commit 0454b0c

Please sign in to comment.