Skip to content

Commit

Permalink
Tests (#45)
Browse files Browse the repository at this point in the history
* Add mocha.

* Add chai.

* Add example test.

* Remove mocha and chai.

* Add basic travis script.

* Check with htmlproofer.

* Update README file.

* Add gulp build command to npm.

* Print ls after npm install.

* Move ls.

* Install gulp global.

* Travis works.
  • Loading branch information
Nir Galon authored Aug 18, 2016
1 parent 21f348b commit 39699b6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 1 deletion.
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sudo: false

language: ruby
rvm:
- 2.1

env:
global:
# speeds up installation of html-proofer
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true

install:
- npm install
- npm install -g gulp
- gem install jekyll jekyll-paginate html-proofer

script:
- gulp build
- rm -R ./_site/node_modules
- htmlproofer ./_site --disable-external
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,10 @@ You can easily deploy your site build to gh-pages branch with the command
```shell
$ npm run gulp deploy
```

## Tests

If you want to run the tests on your local machine please install `gem install html-proofer`. And then run the tests using
```shell
$ htmlproofer ./_site --disable-external
```
6 changes: 6 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ gulp.task('deploy', ['sass', 'javascript', 'jekyll-build'], function() {
.pipe(ghPages());
});

/**
* Build the jekyll site, created for testing.
*/
gulp.task('build', ['sass', 'javascript', 'jekyll-build'], function() {
return gulp.src('./_site/**/*');
});

/**
* Default task, running just `gulp` will compile the sass,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "A tech blog written by Nir Galon. The posts are about computer science (data structures, algorithms, computer networks, operating system, and machine learning), open source (linux, git, arduino, contribution), software development (programming, programming languages, frameworks, design patterns, and architecture), security information (pen testing and whitehat hackers), Google stuff (search, android, chrome, chrome os, and web apps), etc.",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "mocha tests/index.test.js -w",
"gulp": "gulp",
"gulp deploy": "gulp deploy"
},
Expand Down

0 comments on commit 39699b6

Please sign in to comment.