Skip to content
This repository was archived by the owner on Sep 14, 2022. It is now read-only.

Commit fc12fa7

Browse files
author
HarishRaj11
committed
Swagger-node refracted
1 parent 0cb7436 commit fc12fa7

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

lib/commands/project/project.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,9 +536,18 @@ function testGenerate(directory, options, cb) {
536536
}
537537
}
538538
}, function(filteredResult) {
539-
finalResult.forEach(function(file){
540-
fs.outputFile(path.join(directory,'/test/api/client', file.name), file.test.replace(/x-enum/g, "enum"), cb);
541-
});
539+
async.each(filteredResult, function(file, cb) {
540+
console.log(file.name + " " + file.test);
541+
if (file.name === '.env') {
542+
fs.outputFile(path.join(directory, file.name), file.test, cb);
543+
} else {
544+
fs.outputFile(path.join(directory, '/test/api/client', file.name), file.test.replace(/x-enum/g, "enum"), cb);
545+
}
546+
}, function(err) {
547+
if (runInstall) {
548+
installDependencies(directory, 'Success! You may now run your tests.', cb);
549+
}
550+
});
542551
});
543552
});
544553
});

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"serve-static": "^1.9.2",
3232
"swagger-converter": "^1.4.1",
3333
"swagger-editor": "^2.9.2",
34-
"swagger-test-templates": "^1.2.0",
34+
"swagger-test-templates": "git+https://github.com/HarishRaj11/swagger-test-templates.git",
3535
"swagger-tools": "^0.10.1"
3636
},
3737
"devDependencies": {
@@ -54,4 +54,4 @@
5454
"swagger": "bin/swagger.js",
5555
"swagger-project": "bin/swagger-project.js"
5656
}
57-
}
57+
}

test/util/cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,14 @@ describe('cli', function() {
230230

231231
it('should print the result of the command', function() {
232232

233-
cli.execute(executeNoError)(1);
233+
cli.execute(executeNoError)('1');
234234
exitCode.should.equal(0);
235235
capture.output().should.equal('1\n');
236236
});
237237

238238
it('should print the result with header', function() {
239239

240-
cli.execute(executeNoError, 'whatever')(1);
240+
cli.execute(executeNoError, 'whatever')('1');
241241
exitCode.should.equal(0);
242242
capture.output().should.equal('whatever\n========\n1\n');
243243
});

0 commit comments

Comments
 (0)