forked from pixijs/pixijs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
49 lines (42 loc) · 1.1 KB
/
index.js
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict';
const Renderer = require('./lib/Renderer');
const path = require('path');
describe('renders', function ()
{
before(function ()
{
this.renderer = new Renderer();
this.validate = function (id, done)
{
const code = path.join(__dirname, 'tests', `${id}.js`);
const solution = path.join(__dirname, 'solutions', `${id}.json`);
this.renderer.compare(code, solution, (err, success) =>
{
if (err)
{
assert(false, err.message);
}
assert(success, 'Render not successful');
done();
});
};
});
beforeEach(function ()
{
this.renderer.clear();
});
after(function ()
{
this.renderer.destroy();
this.renderer = null;
this.validate = null;
});
it('should draw a rectangle', function (done)
{
this.validate('graphics-rect', done);
});
it('should draw a sprite', function (done)
{
this.validate('sprite-new', done);
});
});