I'm trying to run tests on gulp for my Polymer elements, using eslint, but it doesn't seem to find out about my included browser.js file, because it returns stuff like "error 'suite' is not defined no-undef".
My gulpfile.js :
'use strict';
var gulp = require('gulp');
var wct = require('web-component-tester').test;
var $ = require('gulp-load-plugins')();
gulp.task('lint', function (){
return gulp.src(["test/visualization-app/*.html"])
.pipe($.eslint())
.pipe($.eslint.format())
.pipe($.eslint.failAfterError());
});
gulp.task('default', ['lint'], function() {
});
And here is a test suite that I use :
<!doctype html>
<html>
<head>
<title>visualization-app test</title>
<meta charset = "utf-8">
<meta name = "viewport" content = "width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<script src = "../../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
<script src = "../../bower_components/web-component-tester/browser.js"></script>
<link rel="import" href="../../src/visualization-app/visualization-app.html">
</head>
<body>
<test-fixture id="basic">
<template>
<visualization-app></visualization-app>
</template>
</test-fixture>
<script>
suite('visualization-app', function() {
test('instantiating the element works', function() {
//Simply trying to show my test results on the console
assert.isTrue(false);
});
});
</script>
</body>
</html>
And finally the the gulp command for this test :
D:\rtdb\elk\rtdb-polymer>gulp
[10:48:25] Using gulpfile D:\rtdb\elk\rtdb-polymer\gulpfile.js
[10:48:25] Starting 'lint'...
[10:48:26]
D:\rtdb\elk\rtdb-polymer\test\visualization-app\visualization-app_test.html
21:7 error 'suite' is not defined no-undef
23:11 error 'test' is not defined no-undef
25:15 error 'assert' is not defined no-undef
? 3 problems (3 errors, 0 warnings)
[10:48:26] 'lint' errored after 624 ms
[10:48:26] ESLintError in plugin 'gulp-eslint'
Message:
Failed with 3 errors
I'm very new to all these tools and to web-development in general, so there must be something very simple that I'm not doing right, but after 24 hours I still can't seem to find.
EDIT: I do have the eslint-plugin-html installed and on my .eslintrc.json