1 |
|
2 |
|
3 | 'use strict';
|
4 | require('should');
|
5 | var Stringify = require('../index');
|
6 |
|
7 | describe('the "stringify" function', function () {
|
8 | before(function () {
|
9 | this.test_string = '<html><head></head><body><h1 class="bananas" title="donkies">' +
|
10 | 'This is my test string HTML!</h1></body></html>';
|
11 |
|
12 | this.stringified_content = Stringify.stringify(this.test_string);
|
13 | });
|
14 |
|
15 | it('should have returned a string', function () {
|
16 | this.stringified_content.should.be.a.String;
|
17 | });
|
18 |
|
19 | it('should begin with module.exports = "', function () {
|
20 | this.stringified_content.should.startWith('module.exports = "');
|
21 | });
|
22 |
|
23 |
|
24 | it('should have perserved newline characters', function () {
|
25 | this.stringified_content.should.match(/\n/);
|
26 | });
|
27 |
|
28 | it('should have escaped the double-quotes', function () {
|
29 | this.stringified_content.should.match(/\\\"/);
|
30 | });
|
31 | });
|