Skip to content

Commit

Permalink
Ref #105 Added jasmine and testcases
Browse files Browse the repository at this point in the history
- testcases for initialization, callbacks, pagination
- added gulp task for running testcases

Ref #105 added jasmine(v2.3.4) for test cases

-added test cases for Filter JS initialization
-added test cases for Filter JS callbacks
-added a gulp task for running test cases

Ref #105 added test cases for Filter JS pagination
  • Loading branch information
Aditya Shedge committed Dec 20, 2015
1 parent 63a4ad8 commit f1422fa
Show file tree
Hide file tree
Showing 15 changed files with 14,067 additions and 0 deletions.
19 changes: 19 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var pkg = require('./package.json'),
views: ['src/views/*.html'],
dist: 'dist'
},
specs = 'spec/*_spec.js'
uncompressedJs = 'filter.js',
compressedJs = 'filter.min.js';

Expand Down Expand Up @@ -79,6 +80,7 @@ gulp.task('scripts', function() {
gulp.task('watch', function() {
gulp.watch(scripts, ['scripts']);
gulp.watch(paths.lib, ['scripts']);
gulp.watch(specs, browserSync.reload)
});

gulp.task('browser-sync', function() {
Expand All @@ -99,3 +101,20 @@ gulp.task('build', function(cb){
gulp.task('default', function(cb){
runSequence('clean', 'scripts', ['browser-sync', 'watch'])
});

gulp.task('spec', function() {
browserSync({
server: {
baseDir: './spec',
index: 'SpecRunner.html',
routes: {
'/spec/lib/jquery.js': './spec/lib/jquery.js',
'/dist/filter.js': './dist/filter.js'
}
}
});
});

gulp.task('test', function(cb){
runSequence('spec', 'watch')
});
Empty file added spec/.keep
Empty file.
55 changes: 55 additions & 0 deletions spec/SpecRunner.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Filter JS Specs</title>

<link rel="shortcut icon" type="image/png" href="lib/jasmine-2.3.4/jasmine_favicon.png">
<link rel="stylesheet" href="lib/jasmine-2.3.4/jasmine.css">

<script type="text/javascript" src="lib/jasmine-2.3.4/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-2.3.4/jasmine-html.js"></script>
<script type="text/javascript" src="lib/jasmine-2.3.4/boot.js"></script>

<!-- include source files here... -->
<script type="text/javascript" src="lib/jquery.js"></script>
<script type="text/javascript" src="dist/filter.js"></script>

<script type="text/javascript" src="data/movies.js"></script>
<!-- include spec files here... -->
<script src="filterjs_spec.js"></script>
</head>

<body>
<div class="container" style="display: none;">
<div>
<input type="text" class="form-control" id="searchbox" placeholder="Search &hellip;" autocomplete="off">
</div>

<table class="movies" id="movies">
<thead>
<tr>
<th>Name</th>
<th>Director</th>
<th>Actors</th>
<th>Year</th>
</thead>
</table>

<div id="pagination" class="movies-pagination"></div>
<div>
Per Page: <span id="per_page"></span>
</div>

<script id="movie-template" type="text/html">
<tr>
<td><%= name %></td>
<td><%= director %></td>
<td><%= stars %></td>
<td><%= year %></td>
</div>
</tr>
</script>
</div>
</body>
</html>
Loading

0 comments on commit f1422fa

Please sign in to comment.