forked from mozilla/testpilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add linting for frontend/static-src/tests dir
- Loading branch information
Showing
9 changed files
with
28 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
if (typeof(window) === 'object') { | ||
var tapeDom = require('tape-dom'); | ||
const tapeDom = require('tape-dom'); | ||
tapeDom.installCSS(); | ||
tapeDom.stream(require('tape-catch')); | ||
} | ||
|
||
require('./collections/*js', {mode: 'expand'}); | ||
require('./collections/*.js', {mode: 'expand'}); | ||
require('./lib/*.js', {mode: 'expand'}); | ||
require('./models/*.js', {mode: 'expand'}); | ||
require('./views/*.js', {mode: 'expand'}); |
7 changes: 4 additions & 3 deletions
7
testpilot/frontend/static-src/test/collections/experiments.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
var test = require('tape-catch'); | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
const test = require('tape-catch'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
|
||
test('Running Tests for '+__filename, function(a) { | ||
test('Running Tests for ' + __filename, (a) => { | ||
a.end(); | ||
}); | ||
|
||
test('Each image in images directory has a retina version', function(t) { | ||
test('Each image in images directory has a retina version', (t) => { | ||
t.plan(1); | ||
t.comment(path.resolve(__dirname, '../images')) | ||
fs.readdir(path.resolve(__dirname, '../images'), function(err, files) { | ||
t.comment(path.resolve(__dirname, '../images')); | ||
fs.readdir(path.resolve(__dirname, '../images'), (err, files) => { | ||
if (err) t.fail('fs.readdir call failed, check your paths'); | ||
|
||
files = files.filter(function(f) { | ||
const origFiles = files.filter((f) => { | ||
return (!~f.indexOf('favicon.ico')); // exclude favicon | ||
}); | ||
|
||
const retinaFiles = files.filter(function(f) { | ||
const retinaFiles = files.filter((f) => { | ||
return !!~f.indexOf('@2x'); | ||
}); | ||
|
||
t.same(retinaFiles.length, files.length / 2); | ||
t.same(retinaFiles.length, origFiles.length / 2); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta charset="utf-8" /> | ||
<title>tape-dom tests</title> | ||
</head> | ||
<body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,21 +11,21 @@ test('enabled property is initialized as false by default', t => { | |
|
||
test('install event sets enabled property', t => { | ||
t.plan(1); | ||
const model = new Experiment({id:'[email protected]', | ||
const model = new Experiment({id: '[email protected]', | ||
title: 'test experiment 1'}); | ||
|
||
app.trigger('addon-install:install-ended', {id:'[email protected]'}); | ||
app.trigger('addon-install:install-ended', {id: '[email protected]'}); | ||
|
||
t.equal(model.enabled, true); | ||
}); | ||
|
||
test('uninstall event unsets enabled property', t => { | ||
t.plan(1); | ||
const model = new Experiment({id:'[email protected]', | ||
const model = new Experiment({id: '[email protected]', | ||
title: 'test experiment 1', | ||
enabled: true}); | ||
|
||
app.trigger('addon-uninstall:uninstall-ended', {id:'[email protected]'}); | ||
app.trigger('addon-uninstall:uninstall-ended', {id: '[email protected]'}); | ||
|
||
t.equal(model.enabled, false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters