Skip to content

Commit

Permalink
Fix jshint warnings to test javascript and adopt to jshint
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynalon committed Nov 10, 2015
1 parent 71eab82 commit 82cd3a9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
10 changes: 5 additions & 5 deletions unittests/spec/test_datamodels.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ describe('DataModels', function() {
var navParser;
beforeEach(function () {
loadFixtures('rendered-markdown/navigation.html');
var navElements = $("#basic-navigation").children();
var navElements = $('#basic-navigation').children();
navParser = new MDwiki.DataModels.NavigationBarParser(navElements);
});

it('should find the page title', function() {
var model = navParser.parse();
expect(model.pageTitle).toBe("MDwiki");
expect(model.pageTitle).toBe('MDwiki');
});


Expand All @@ -24,9 +24,9 @@ describe('DataModels', function() {

it('should find the top-level entries in the correct order with their text',function() {
var model = navParser.parse();
expect(model.toplevelEntries[0].title).toBe("About");
expect(model.toplevelEntries[1].title).toBe("Docs");
expect(model.toplevelEntries[2].title).toBe("Gimmicks");
expect(model.toplevelEntries[0].title).toBe('About');
expect(model.toplevelEntries[1].title).toBe('Docs');
expect(model.toplevelEntries[2].title).toBe('Gimmicks');
});

it('find sublevel entries',function() {
Expand Down
1 change: 1 addition & 0 deletions unittests/spec/test_gimmick.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ describe('GimmickHandler', function() {
});

describe('Gimmick', function() {
'use strict';

beforeEach(function() {
// loadFixtures('gimmick.html');
Expand Down
6 changes: 3 additions & 3 deletions unittests/spec/test_markdown_postprocessing.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ describe('MarkdownPostProcessor', function() {
//var rendered = marked(md);

it('should correctly postprocess a multiline gimmick', function() {
var input = $("#postprocessing-multiline-gimmick");
var input = $('#postprocessing-multiline-gimmick');
postprocessor.process(input);

expect(input.find("code").hasClass("gimmick:somegimmick")).toBe(true);
expect(input.find("code").hasClass("lang-gimmick:somegimmick")).toBe(false);
expect(input.find('code').hasClass('gimmick:somegimmick')).toBe(true);
expect(input.find('code').hasClass('lang-gimmick:somegimmick')).toBe(false);
});
});
12 changes: 6 additions & 6 deletions unittests/spec/test_stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ describe('Stages', function() {

describe('StageChain', function() {

var two_test_stages = ['first', 'second']
var two_test_stages = ['first', 'second'];

it('should process all stages', function (jasmineDone) {
var stage_chain = new MDwiki.Stages.StageChain(two_test_stages);

var count = 0;
stage_chain.getStage("first").subscribe(function (done) {
stage_chain.getStage('first').subscribe(function (done) {
count++;
done();
});
stage_chain.getStage("second").subscribe(function (done) {
stage_chain.getStage('second').subscribe(function (done) {
count++;
done();
});
Expand All @@ -24,7 +24,7 @@ describe('Stages', function() {
it('should not allow a stage to a previous stage', function(jasmineDone) {
var stage_chain = new MDwiki.Stages.StageChain(two_test_stages);
var exception_thrown = false;

stage_chain.getStage('second').subscribe(function(done) {
try {
stage_chain.getStage('first').subscribe(function(done) {
Expand All @@ -42,8 +42,8 @@ describe('Stages', function() {
});
});

describe("Stage", function() {
it("should allow to subscribe to self", function() {
describe('Stage', function() {
it('should allow to subscribe to self', function() {
var stage = new MDwiki.Stages.Stage('sample');
var count = 0;
stage.subscribe(function(done1) {
Expand Down

0 comments on commit 82cd3a9

Please sign in to comment.