var assert = require('chai').assert;
var sinon = require('sinon');

let LMLayer = require('../../build');

// Test the top-level LMLayer interface.
// Note: these tests can only be run after BOTH stages of compilation are completed.
describe('LMLayer', function() {
  describe('[[constructor]]', function () {
    it('should be take a Worker to instantiate', function () {
      let fakeWorker = {
        postMessage: sinon.fake(),
        onmessage: null
      };
      new LMLayer(fakeWorker);
    });
  });

  // Since the Blob API is browser-specific, look for those tests
  // for .asBlobURI() in the in_browser tests.
  describe('.unwrap', function () {
    it('should return the inner code of a function', function () {
      // Create a multi-line function body we can match in a RegExp.
      let text = LMLayer.unwrap(function hello() {
        var hello;
        var world;
      });
      // Unwrap should give us back ONLY the body. Whitespace isn't really important.
      assert.match(text, /^\s*var\s+hello;\s*var\s+world;\s*$/);
    });
  });
});

@@ -322,15 +322,14 @@
 uld 
-be take
+accept
  a W
@@ -504,16 +504,626 @@
 %0A  %7D);%0A%0A
+  describe('#initialize()', function () %7B%0A    it('should accept capabilities and model description', function () %7B%0A      let fakeWorker = %7B%0A        postMessage: sinon.fake(),%0A        onmessage: null%0A      %7D;%0A%0A      let lmLayer = new LMLayer(fakeWorker);%0A      lmLayer.initialize(%0A        %7B%0A          maxLeftContextCodeUnits: 32,%0A        %7D,%0A        %7B%0A          kind: 'wordlist',%0A          words: %5B'foo', 'bar', 'baz', 'quux'%5D%0A        %7D%0A      );%0A%0A      assert.isFunction(fakeWorker.onmessage, 'LMLayer failed to set a callback!');%0A      assert.propertyVal(fakeWorker.postMessage, 'callCount', 1);%0A    %7D);%0A  %7D);%0A%0A
   // Sin
@@ -1145,24 +1145,27 @@
  is 
-browser-specific
+limited to browsers
 , lo
@@ -1180,19 +1180,19 @@
 hose
+%0A  //
  tests
-%0A  //
  for

Test basic usage of LMLayer#initialize()