File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ module.exports = {
56
56
var fileOutputPattern = this . readConfig ( 'fileOutputPattern' ) ;
57
57
var inputPath = path . join ( distDir , fileInputPattern ) ;
58
58
var outputPath = path . join ( distDir , fileOutputPattern ) ;
59
- var absoluteInputPath = path . join ( root , inputPath ) ;
60
- var absoluteOutputPath = path . join ( root , outputPath ) ;
59
+ var absoluteInputPath = path . resolve ( root , inputPath ) ;
60
+ var absoluteOutputPath = path . resolve ( root , outputPath ) ;
61
61
62
62
this . log ( 'generating `' + outputPath + '` from `' + inputPath + '`' , { verbose : true } ) ;
63
63
Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ describe('the deploy plugin object', function() {
8
8
var fakeRoot ;
9
9
var plugin ;
10
10
var promise ;
11
+ var distDir ;
11
12
12
13
before ( function ( ) {
13
- fakeRoot = process . cwd ( ) + '/tests/fixtures' ;
14
+ fakeRoot = process . cwd ( ) + '/tests/fixtures' ;
15
+ distDir = 'dist' ;
14
16
} ) ;
15
17
16
18
beforeEach ( function ( ) {
@@ -33,7 +35,7 @@ describe('the deploy plugin object', function() {
33
35
fileInputPattern : 'index.html' ,
34
36
fileOutputPattern : 'index.json' ,
35
37
distDir : function ( context ) {
36
- return 'dist' ;
38
+ return distDir ;
37
39
} ,
38
40
projectRoot : function ( context ) {
39
41
return fakeRoot ;
@@ -80,5 +82,20 @@ describe('the deploy plugin object', function() {
80
82
assert . deepEqual ( result . distFiles , [ 'index.json' ] ) ;
81
83
} ) ;
82
84
} ) ;
85
+
86
+ describe ( 'when the distDir is an absolute path' , function ( ) {
87
+ before ( function ( ) {
88
+ distDir = fakeRoot + '/dist' ;
89
+ } ) ;
90
+
91
+ it ( 'still works' , function ( ) {
92
+ return assert . isFulfilled ( promise )
93
+ . then ( function ( ) {
94
+ var json = require ( fakeRoot + '/dist/index.json' ) ;
95
+
96
+ assert . equal ( Object . keys ( json ) . length , 4 ) ;
97
+ } ) ;
98
+ } ) ;
99
+ } ) ;
83
100
} ) ;
84
101
} ) ;
You can’t perform that action at this time.
0 commit comments