Skip to content

Commit

Permalink
Update tabs tests to fix lint error and use globals and chai should
Browse files Browse the repository at this point in the history
  • Loading branch information
ediblecode committed Sep 26, 2016
1 parent 0359973 commit 6f43336
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions test/unit/tabs.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/* eslint-env node, mocha */

const should = require("should");
/* eslint-env node, mocha, jquery */

const KeyCodes = {
Enter: 13,
Expand All @@ -15,9 +13,11 @@ const KeyCodes = {

describe("Tabs", function() {

var $,
document,
Tabs;
var Tabs;

before(function () {
Tabs = require("../../src/javascripts/tabs.js").default;
});

var tabsHTML = `
<div class="tabs" data-nice-plugin="tabs">
Expand Down Expand Up @@ -57,17 +57,10 @@ describe("Tabs", function() {
</div>
`;

before(function () {
document = global.document;
$ = global.$;

Tabs = require("../../src/javascripts/tabs.js").default;
});

describe("jQuery integration", function() {

it("defined on jquery object", function() {
$(document).tabs.should.be.ok();
$(document).tabs.should.be.ok;
});

it("have defaults", function() {
Expand Down Expand Up @@ -102,8 +95,10 @@ describe("Tabs", function() {
Tabs.should.have.property("defaults");
});

it("throw without element", function() {
should.throws(() => new Tabs);
it("throw error without element", function() {
(() => {
new Tabs;
}).should.throw(Error);
});

});
Expand Down

0 comments on commit 6f43336

Please sign in to comment.