Skip to content

Commit e89ad73

Browse files
author
benholloway
committed
updated tests for css assets, updated test references to appropriate tags
1 parent 8b57356 commit e89ad73

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
},
112112
"devDependencies": {
113113
"angularity-helloworld-es5": "angularity/angularity-helloworld-es5#ci-build-0.2.0-E",
114-
"angularity-todo-es5": "angularity/angularity-todo-es5#ci-build-0.2.0-F",
114+
"angularity-todo-es5": "angularity/angularity-todo-es5#ci-build-0.3.1-A",
115115
"autodocs": "^0.6.8",
116116
"jasmine-diff-matchers": "~2.0.0",
117117
"jasmine-node": "2.0.0-beta4",

test/specs/tasks/css-task.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

3-
var diffMatchers = require('jasmine-diff-matchers');
3+
var diffMatchers = require('jasmine-diff-matchers'),
4+
fs = require('fs'),
5+
path = require('path');
46

57
var helper = require('./../../helpers/angularity-test'),
68
matchers = require('./../../helpers/jasmine-matchers');
@@ -10,11 +12,25 @@ var BUILD_FOLDER = 'app-build';
1012
function expectations(testCase) {
1113
var workingBuildFile = helper.getConcatenation(testCase.cwd, BUILD_FOLDER);
1214
var sourceBuildFile = helper.getConcatenation(testCase.sourceDir, testCase.subdir, BUILD_FOLDER);
15+
16+
// general
1317
expect(testCase.stdout).toBeTask('css');
18+
19+
// build output
1420
expect(testCase.cwd).toHaveExpectedCssExcept();
1521
expect(workingBuildFile('index.css')).diffFilePatch(sourceBuildFile('index.css'));
16-
// expect(workingBuildFile('index.css.map')).diffFilePatch(sourceBuildFile('index.css.map'));
17-
// TODO @bholloway solve repeatability of .map files
22+
// expect(workingBuildFile('index.css.map')).diffFilePatch(sourceBuildFile('index.css.map'));
23+
// TODO @bholloway solve repeatability of .map files
24+
25+
// css assets
26+
var assetDir = path.join.apply(path, sourceBuildFile('index.css.assets'));
27+
if (fs.existsSync(assetDir)) {
28+
fs.readdirSync(assetDir)
29+
.forEach(function eachAsset(relative) {
30+
console.log(relative);
31+
expect(workingBuildFile(relative)).diffFilePatch(sourceBuildFile(relative));
32+
});
33+
}
1834
}
1935

2036
function customMatchers() {

0 commit comments

Comments
 (0)