This repository has been archived by the owner on May 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf(*): implementaçao estável do travis, semantic-release e testes u…
…nitários
- Loading branch information
Showing
11 changed files
with
986 additions
and
173 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,42 @@ | ||
'use strict'; | ||
|
||
const gulp = require('gulp'); | ||
const concat = require('gulp-concat'); | ||
const beautify = require('gulp-beautify'); | ||
const include = require('gulp-include'); | ||
const strip = require('gulp-strip-comments'); | ||
const del = require('del'); | ||
var gulp = require('gulp'); | ||
var concat = require('gulp-concat'); | ||
var beautify = require('gulp-beautify'); | ||
var include = require('gulp-include'); | ||
var strip = require('gulp-strip-comments'); | ||
var del = require('del'); | ||
var replace = require('gulp-replace'); | ||
|
||
gulp.task('gtm-modules', () => | ||
gulp | ||
.src(['./core/modules/*.js', './gtm/modules/*js']) | ||
.pipe(concat('gtm-modules.js')) | ||
.pipe(beautify({ | ||
indent_size: 2 | ||
})) | ||
.pipe(strip()) | ||
.on('error', console.log) | ||
.pipe(gulp.dest('./tmp')) | ||
); | ||
gulp.task('gtm-modules', function() { | ||
return gulp.src(['./core/modules/*.js', './gtm/modules/*js']) | ||
.pipe(replace(/module.exports[a-z-A-Z.]*\s*=\s*([a-zA-Z\-_]+;|([a-zA-Z\-_:.={},\n\s]+);+)/g, '')) | ||
.pipe(concat('gtm-modules.js')) | ||
.pipe(beautify({ | ||
indent_size: 2, | ||
max_preserve_newlines: 2 | ||
})) | ||
.pipe(strip()) | ||
.on('error', console.log) | ||
.pipe(gulp.dest('./tmp')); | ||
}); | ||
|
||
gulp.task('build-gtm', () => | ||
gulp | ||
.src('./gtm/main.js') | ||
.pipe(include({ | ||
includePaths: ['/tmp', '/gtm'].map(path => __dirname + path), | ||
hardFail: true | ||
})) | ||
.on('error', console.log) | ||
.pipe(gulp.dest('./build/gtm')) | ||
); | ||
gulp.task('build-gtm', function() { | ||
return gulp.src('./gtm/main.js') | ||
.pipe(replace(/module.exports\s*=\s*[a-zA-Z]+;/g, '')) | ||
.pipe(include({ | ||
hardFail: true, | ||
includePaths: [ | ||
__dirname + '/tmp', | ||
__dirname + '/gtm', | ||
] | ||
})) | ||
.on('error', console.log) | ||
.pipe(gulp.dest('./build/gtm')); | ||
}); | ||
|
||
gulp.task('clean', () => del(['./tmp'])); | ||
gulp.task('clean', function() { | ||
return del(['./tmp']); | ||
}); | ||
|
||
gulp.task('default', gulp.series(['clean', 'gtm-modules', 'build-gtm', 'clean'])); | ||
gulp.task('default', gulp.series(['clean', 'gtm-modules', 'build-gtm', 'clean'])); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,109 @@ | ||
{ | ||
"name": "analytics-helper", | ||
"version": "1.0.1", | ||
"description": "> Biblioteca auxiliar para implementação dos Tag Managers da DP6.", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/joaquimsn/analytics-helper.git" | ||
}, | ||
"author": "", | ||
"contributors": [ | ||
{ | ||
"name": "Bruno Munhoz", | ||
"email": "bpm1993@gmail.com" | ||
"name": "analytics-helper", | ||
"version": "1.0.1", | ||
"description": "> Biblioteca auxiliar para implementação dos Tag Managers da DP6.", | ||
"main": "index.js", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/DP6/analytics-helper.git" | ||
}, | ||
{ | ||
"name": "Paulo Brumatti", | ||
"email": "paulo8624@gmail.com" | ||
} | ||
], | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/joaquimsn/analytics-helper/issues" | ||
}, | ||
"homepage": "https://github.com/joaquimsn/analytics-helper#readme", | ||
"scripts": { | ||
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary --reporter=text mocha test/index.test.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
"per-file": true, | ||
"lines": [ | ||
80, | ||
99 | ||
"author": "", | ||
"contributors": [ | ||
{ | ||
"name": "Bruno Munhoz", | ||
"email": "bpm1993@gmail.com" | ||
}, | ||
{ | ||
"name": "Paulo Brumatti", | ||
"email": "paulo8624@gmail.com" | ||
} | ||
], | ||
"statements": [ | ||
90, | ||
99 | ||
], | ||
"functions": [ | ||
90, | ||
99 | ||
], | ||
"branches": [ | ||
80, | ||
99 | ||
], | ||
"exclude": [ | ||
"build", | ||
"documentation-images" | ||
], | ||
"include": [ | ||
"core/**/*.js", | ||
"gtm/*.js", | ||
"gtm/**/*.js" | ||
], | ||
"reporter": [ | ||
"lcov", | ||
"text-summary", | ||
"text" | ||
], | ||
"require": [ | ||
"@babel/register" | ||
], | ||
"sourceMap": false, | ||
"instrument": false | ||
}, | ||
"release": { | ||
"branch": "master", | ||
"verifyConditions": [ | ||
"@semantic-release/github" | ||
], | ||
"publish": [ | ||
"@semantic-release/github" | ||
], | ||
"prepare": [], | ||
"success": [ | ||
"@semantic-release/github" | ||
], | ||
"fail": [ | ||
"@semantic-release/github" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.1", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"babel-plugin-istanbul": "^5.0.1", | ||
"chai": "^4.1.2", | ||
"coveralls": "^3.0.2", | ||
"cross-env": "^5.2.0", | ||
"del": "^3.0.0", | ||
"gulp": "^3.9.1", | ||
"gulp-beautify": "^2.0.1", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-include": "^2.3.1", | ||
<<<<<<< HEAD | ||
"gulp-minify": "^2.1.0", | ||
"gulp-replace": "^1.0.0", | ||
======= | ||
>>>>>>> 0f9f68c... Remoção de plugins sem uso | ||
"gulp-strip-comments": "^2.5.2", | ||
"gulp-sync": "^0.1.4", | ||
"gulp-uglify": "^3.0.0", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.0.1", | ||
"sonarqube-scanner": "^2.1.1" | ||
}, | ||
"dependencies": {} | ||
"license": "ISC", | ||
"bugs": { | ||
"url": "https://github.com/DP6/analytics-helper/issues" | ||
}, | ||
"homepage": "https://github.com/DP6/analytics-helper#readme", | ||
"scripts": { | ||
"test": "cross-env NODE_ENV=test nyc --reporter=lcov --reporter=text-summary --reporter=text mocha test/index.test.js", | ||
"coverage": "nyc report --reporter=text-lcov | coveralls" | ||
}, | ||
"nyc": { | ||
"check-coverage": true, | ||
"per-file": true, | ||
"lines": [ | ||
80, | ||
99 | ||
], | ||
"statements": [ | ||
90, | ||
99 | ||
], | ||
"functions": [ | ||
90, | ||
99 | ||
], | ||
"branches": [ | ||
80, | ||
99 | ||
], | ||
"exclude": [ | ||
"build", | ||
"documentation-images" | ||
], | ||
"include": [ | ||
"core/**/*.js", | ||
"gtm/*.js", | ||
"gtm/**/*.js" | ||
], | ||
"reporter": [ | ||
"lcov", | ||
"text-summary", | ||
"text" | ||
], | ||
"require": [ | ||
"@babel/register" | ||
], | ||
"sourceMap": false, | ||
"instrument": false | ||
}, | ||
"release": { | ||
"branch": "master", | ||
"verifyConditions": [ | ||
"@semantic-release/github" | ||
], | ||
"publish": [ | ||
"@semantic-release/github" | ||
], | ||
"prepare": [], | ||
"success": [ | ||
"@semantic-release/github" | ||
], | ||
"fail": [ | ||
"@semantic-release/github" | ||
] | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.1", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"babel-plugin-istanbul": "^5.0.1", | ||
"chai": "^4.1.2", | ||
"coveralls": "^3.0.2", | ||
"cross-env": "^5.2.0", | ||
"del": "^3.0.0", | ||
"gulp": "^4.0.0", | ||
"gulp-beautify": "^2.0.1", | ||
"gulp-concat": "^2.6.1", | ||
"gulp-include": "^2.3.1", | ||
"gulp-minify": "^2.1.0", | ||
"gulp-replace": "^1.0.0", | ||
"gulp-strip-comments": "^2.5.2", | ||
"gulp-uglify": "^3.0.0", | ||
"jsdom": "^13.0.0", | ||
"mocha": "^5.2.0", | ||
"nyc": "^13.0.1", | ||
"sonarqube-scanner": "^2.1.1" | ||
}, | ||
"dependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
|
||
const expect = require('chai').expect; | ||
const closet = require('../../.././core/modules/closet.js'); | ||
|
||
describe('Core', () => { | ||
describe('Modules', () => { | ||
describe('.closest(elm, seletor)', () => { | ||
it('should export a function', () => { | ||
expect(closet).to.be.a('function'); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
const expect = require('chai').expect; | ||
const cookie = require('../../.././core/modules/cookie.js'); | ||
|
||
describe('Core', () => { | ||
describe('Modules', () => { | ||
describe('.cookie(name, value, opts)', () => { | ||
it('should export a function', () => { | ||
expect(cookie.cookie).to.be.a('function'); | ||
}); | ||
}); | ||
|
||
describe('.getCookie(key)', () => { | ||
it('should export a function', () => { | ||
expect(cookie.setCookie).to.be.a('function'); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.