Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
[WIP] New e2e test folder style. Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
ofrogon committed Feb 10, 2016
1 parent b880f35 commit 0d2717b
Show file tree
Hide file tree
Showing 16 changed files with 617 additions and 136 deletions.
12 changes: 8 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Changelog

## 0.3.2 - 2015-12-24

- Fix cInstall.option.default.folder not impacting the cInstall.folder paths.

## 0.3.1 - 2015-11-01

- Add support for coveralls.io for test coverage report.
- Remove useless dependencies.
- Switch blanket.js for istanbul.js as coverage test reporter.
- Update .travis.iml file to stop use legacy version of Travis CI.
- Update .travis.iml file to stop use legacy version of TravisCI.
- Add test against Node.js v5.

## 0.3.0 - 2015-09-15
Expand All @@ -14,7 +18,7 @@
- Accelerate the execution of the tool on an empty value of the field `cInstall` in the `bower.json` file.
- Update dependencies.
- Fix a possible error when using name with glob star.
- Deprecated the use of `automatic` in the api (was already mark as deprecated in the cmd module).
- Deprecated the use of `automatic` in the API (was already mark as deprecated in the cmd module).
- Better deprecation throw, by using the Node.js `util` module.
- Start using version 1.4.x of q instead of version 2.x.x because it wasn't updated since 2014.

Expand Down Expand Up @@ -71,9 +75,9 @@

## 0.0.3 - 2014-10-27

- Add option to get minimised version of bower dependencies.
- Add option to get minimized version of bower dependencies.
- Add option to set a default folder for minimized files.
- Repair the CLI commands call. Before the CLI section was call as soon as we require the clean-bower-installer module, now it not (as intended).
- Repair the CLI commands call. Before the CLI section was called as soon as we require the clean-bower-installer module, now it is not (as intended).

## 0.0.2 - 2014-10-08

Expand Down
15 changes: 12 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

module.exports = function(grunt) {
grunt.initConfig({
grunt.config.init({
pkg: grunt.file.readJSON("package.json"),
setup: {
"testDir": ".testFolder"
Expand Down Expand Up @@ -56,7 +56,16 @@ module.exports = function(grunt) {
quiet: false,
clearRequireCache: false
},
src: ["test/unit/**/*.js"]
src: ["test/unit/**/*.test.js"]
},
e2e: {
options: {
reporter: "spec",
captureFile: "<%= setup.testDir %>/unitResults.txt",
quiet: false,
clearRequireCache: false
},
src: ["test/e2e/**/*.test.js"]
}
},
run: {
Expand Down Expand Up @@ -125,7 +134,7 @@ module.exports = function(grunt) {
grunt.registerTask("codeQualityCheckup", ["jshint:dev"]);

// Run the useful development tests
grunt.registerTask("test", ["run:runTests", "unit", "coverage"]);
grunt.registerTask("test", ["run:runTests", "coverage"]);

// Run the action to test before committing
grunt.registerTask("preCommit", ["jshint:prod", "test"]);
Expand Down
30 changes: 15 additions & 15 deletions lib/api.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"use strict";

var q = require("q"),
var Q = require("q"),
cmd = require("./cmd"),
cnf = require("./readConfig"),
util = require("util");

/**
* Call cmd.js command using promise
*
* @param promise {Promise<T>}
* @param promise {Promise<Q>}
* @param cmd {Function}
* @param option {Object}
*/
Expand All @@ -27,7 +27,7 @@ function callCmd(promise, cmd, option) {
cnf.read(option).then(
function (config) {
if (config === "Nothing to do!") {
promise.resolve("Nothing to do!");
promise.resolve(config);
} else {
cmd(config).then(
function (res) {
Expand All @@ -54,10 +54,10 @@ module.exports = {
* Execute the automatic
*
* @param [option] {Object}
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
automatic: util.deprecate(function (option) {
var deferred = q.defer();
var deferred = Q.defer();

callCmd(deferred, cmd.automatic, option);

Expand All @@ -67,10 +67,10 @@ module.exports = {
* Execute the install
*
* @param [option] {Object}
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
install: function (option) {
var deferred = q.defer();
var deferred = Q.defer();

callCmd(deferred, cmd.install, option);

Expand All @@ -80,10 +80,10 @@ module.exports = {
* Execute the update
*
* @param [option] {Object}
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
update: function (option) {
var deferred = q.defer();
var deferred = Q.defer();

callCmd(deferred, cmd.update, option);

Expand All @@ -93,10 +93,10 @@ module.exports = {
* Simply run the clean-bower-installer without bower call
*
* @param [option] {Object}
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
run: function (option) {
var deferred = q.defer();
var deferred = Q.defer();

callCmd(deferred, cmd.run, option);

Expand All @@ -106,10 +106,10 @@ module.exports = {
* Run the clean-bower-installer with the min option, without bower call
*
* @param [option] {Object}
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
runMin: function (option) {
var deferred = q.defer();
var deferred = Q.defer();

try {
option = option || {option: {min: {}}};
Expand All @@ -130,10 +130,10 @@ module.exports = {
* Run the clean-bower-installer with the min and the renameMin option, without bower call
*
* @param [option] {Object}
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
runMinR: function (option) {
var deferred = q.defer();
var deferred = Q.defer();

try {
option = option || {option: {}};
Expand Down
26 changes: 13 additions & 13 deletions lib/cmd.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict";

var q = require("q"),
var Q = require("q"),
fileManagement = require("./fileManagement"),
exec = require("child_process").exec,
path = require("path"),
Expand All @@ -12,10 +12,10 @@ var q = require("q"),
*
* @param config {{}}
* @param command (String}
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
function callBower(config, command) {
var deferred = q.defer();
var deferred = Q.defer();

/* Bower install done the update if the file already exist so in the case of not knowing which one to use (install or update)
* install will do both.*/
Expand Down Expand Up @@ -53,7 +53,7 @@ function callBower(config, command) {
*
* @param err {String}
* @param cnf {{}}
* @param promise {Promise<T>}
* @param promise {Promise<Q>}
*/
function bowerError(err, cnf, promise) {
if(err === "ENOENT") {
Expand All @@ -67,7 +67,7 @@ function bowerError(err, cnf, promise) {
* Call the file management module
*
* @param config {{}}
* @param promise {Promise<T>}
* @param promise {Promise<Q>}
*/
function callFileManagement(config, promise) {
var fm;
Expand All @@ -92,10 +92,10 @@ module.exports = {
/**
* Execute the automatic
*
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
automatic: function(config) {
var deferred = q.defer();
var deferred = Q.defer();

if (config && config.hasOwnProperty("cwd")) {
callBower(config, "automatic").then(
Expand All @@ -115,10 +115,10 @@ module.exports = {
/**
* Execute the install
*
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
install: function(config) {
var deferred = q.defer();
var deferred = Q.defer();

if (config && config.hasOwnProperty("cwd")) {
callBower(config, "install").then(
Expand All @@ -138,10 +138,10 @@ module.exports = {
/**
* Execute the update
*
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
update: function(config) {
var deferred = q.defer();
var deferred = Q.defer();

if (config && config.hasOwnProperty("cwd")) {
callBower(config, "update").then(
Expand All @@ -161,10 +161,10 @@ module.exports = {
/**
* Simply run the clean-bower-installer without bower call
*
* @returns {Promise<T>}
* @returns {Promise<Q>}
*/
run: function(config) {
var deferred = q.defer();
var deferred = Q.defer();

if (config && config.hasOwnProperty("cwd")) {
fs.stat(path.join(config.cwd, "bower.json"), function(err) {
Expand Down

0 comments on commit 0d2717b

Please sign in to comment.