Skip to content

Commit a98fd30

Browse files
author
Keith Walsh
committed
Add specs
1 parent 75a5698 commit a98fd30

File tree

5 files changed

+48
-2
lines changed

5 files changed

+48
-2
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
language: node_js
2+
node_js:
3+
- "8"
4+
script: jasmine

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Asset Fingerprint Webpack Rails
22
A webpack plugin to fingerprint your JS for consumption by Rails
33

4+
[![Build Status](https://travis-ci.org/coderbydesign/asset-fingerprint-webpack-rails.svg?branch=master)](https://travis-ci.org/coderbydesign/asset-fingerprint-webpack-rails)
5+
46
## Install
57
```
68
npm install asset-fingerprint-webpack-rails --save-dev

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "A webpack plugin to fingerprint your JS for consumption by Rails",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1"
7+
"test": "jasmine"
88
},
99
"repository": {
1010
"type": "git",
@@ -22,5 +22,8 @@
2222
"bugs": {
2323
"url": "https://github.com/coderbydesign/asset-fingerprint-webpack-rails/issues"
2424
},
25-
"homepage": "https://github.com/coderbydesign/asset-fingerprint-webpack-rails#readme"
25+
"homepage": "https://github.com/coderbydesign/asset-fingerprint-webpack-rails#readme",
26+
"devDependencies": {
27+
"jasmine": "^2.8.0"
28+
}
2629
}

spec/indexSpec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
describe("AssetFingerprint", function() {
2+
var AssetFingerprint = require('../index');
3+
var fingerprint;
4+
5+
describe("initialization", function() {
6+
it("should default needsFingerprint = true when no args", function() {
7+
fingerprint = new AssetFingerprint();
8+
expect(fingerprint.needsFingerprint).toBeTruthy();
9+
});
10+
11+
it("should accept true", function() {
12+
fingerprint = new AssetFingerprint(true);
13+
expect(fingerprint.needsFingerprint).toBeTruthy();
14+
});
15+
16+
it("should accept false", function() {
17+
fingerprint = new AssetFingerprint(false);
18+
expect(fingerprint.needsFingerprint).toBeFalsy();
19+
});
20+
21+
it("should accept null", function() {
22+
fingerprint = new AssetFingerprint(null);
23+
expect(fingerprint.needsFingerprint).toBeFalsy();
24+
});
25+
});
26+
});

spec/support/jasmine.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"spec_dir": "spec",
3+
"spec_files": [
4+
"**/*[sS]pec.js"
5+
],
6+
"helpers": [
7+
"helpers/**/*.js"
8+
],
9+
"stopSpecOnExpectationFailure": false,
10+
"random": false
11+
}

0 commit comments

Comments
 (0)