UNPKG

624 BJavaScriptView Raw
1describe('Plugin', function() {
2 var plugin;
3
4 beforeEach(function() {
5 plugin = new Plugin({});
6 });
7
8 it('should be an object', function() {
9 expect(plugin).to.be.ok();
10 });
11
12 it('should has #compile method', function() {
13 expect(plugin.compile).to.be.a(Function);
14 });
15
16 it('should compile and produce valid result', function(done) {
17 var content = 'a = 1';
18 var expected = '(function(){\n var a;\n a = 1;\n}).call(this);\n';
19
20 plugin.compile(content, 'file.ls', function(error, data) {
21 expect(error).not.to.be.ok();
22 expect(data).to.equal(expected)
23 done();
24 });
25 });
26});