File: node.js

package info (click to toggle)
libjs-emojify 1.1.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, sid
  • size: 5,972 kB
  • sloc: makefile: 4
file content (30 lines) | stat: -rw-r--r-- 818 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
var jsdom = require('jsdom');

global.JS = require('jstest');
global.emojify = require('../src/emojify.js');

require('./spec/dom');
require('./spec/tag_type');
require('./spec/string');

global.assertEmoji = function (test, rootEl, emojiTitles) {
    var emojis = rootEl.querySelectorAll('.emoji');
    test.assertEqual(emojiTitles.length, emojis.length);
    for(var i = 0; i < emojis.length; i++) {
        test.assertEqual(emojiTitles[i], emojis[i].title);
    }
};

jsdom.env({
    html: '<html><body></body></html>',
    done: function(errors, win) {
        global.window = win;
        global.document = win.document;
        JS.Test.autorun(function(runner){
            runner.setReporter(new JS.Test.Reporters.Spec())
            runner.addReporter(new JS.Test.Reporters.ExitStatus())
        })
    }
})