Skip to content

Commit fe95205

Browse files
authored
Merge pull request #21 from segmentio/migarte-nielsen-and-kenshoo-infinity
Migarte nielsen and kenshoo infinity
2 parents 5684f83 + 997e3cc commit fe95205

File tree

29 files changed

+12550
-7
lines changed

29 files changed

+12550
-7
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
version: 2
2+
jobs:
3+
test:
4+
docker:
5+
- image: circleci/node:4-browsers
6+
steps:
7+
- checkout
8+
- restore_cache:
9+
key: deps-{{ checksum "yarn.lock" }}
10+
- run:
11+
name: Login to npm
12+
command: |
13+
npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
14+
yarn add codecov
15+
- run:
16+
name: Install dependencies
17+
command: yarn install
18+
- run:
19+
name: Run tests
20+
command: make test
21+
- store_artifacts:
22+
path: coverage
23+
- run:
24+
name: Run coverage
25+
command: ./node_modules/.bin/codecov
26+
- save_cache:
27+
key: deps-{{ checksum "yarn.lock" }}
28+
paths:
29+
- node_modules
30+
publish:
31+
docker:
32+
- image: circleci/node:4-browsers
33+
steps:
34+
- checkout
35+
- run:
36+
name: Login to npm
37+
command: npm config set "//registry.npmjs.org/:_authToken" $NPM_AUTH
38+
- run:
39+
name: Publish to npm
40+
command: npm publish .
41+
workflows:
42+
version: 2
43+
test_and_publish:
44+
jobs:
45+
- test:
46+
filters:
47+
tags:
48+
only: /.*/
49+
- publish:
50+
requires:
51+
- test
52+
filters:
53+
tags:
54+
only: /[0-9]+(\.[0-9]+)*(-.+)?/
55+
branches:
56+
ignore: /.*/
57+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@segment/eslint-config/browser/legacy"
3+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage
2+
node_modules
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
1.0.0 / 2016-12-22
3+
==================
4+
5+
* Initial Release 1.0.0!
6+
7+
0.0.1 / 2016-12-01
8+
==================
9+
10+
* Initial Integration Scaffold!
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
##
2+
# Binaries
3+
##
4+
5+
ESLINT := node_modules/.bin/eslint
6+
KARMA := node_modules/.bin/karma
7+
8+
##
9+
# Files
10+
##
11+
12+
LIBS = $(shell find lib -type f -name "*.js")
13+
TESTS = $(shell find test -type f -name "*.test.js")
14+
SUPPORT = $(wildcard karma.conf*.js)
15+
ALL_FILES = $(LIBS) $(TESTS) $(SUPPORT)
16+
17+
##
18+
# Program options/flags
19+
##
20+
21+
# A list of options to pass to Karma
22+
# Overriding this overwrites all options specified in this file (e.g. BROWSERS)
23+
KARMA_FLAGS ?=
24+
25+
# A list of Karma browser launchers to run
26+
# http://karma-runner.github.io/0.13/config/browsers.html
27+
BROWSERS ?=
28+
ifdef BROWSERS
29+
KARMA_FLAGS += --browsers $(BROWSERS)
30+
endif
31+
32+
ifdef CI
33+
KARMA_CONF ?= karma.conf.ci.js
34+
else
35+
KARMA_CONF ?= karma.conf.js
36+
endif
37+
38+
# Mocha flags.
39+
GREP ?= .
40+
41+
##
42+
# Tasks
43+
##
44+
45+
# Install node modules.
46+
node_modules: package.json $(wildcard node_modules/*/package.json)
47+
@npm install
48+
@touch $@
49+
50+
# Install dependencies.
51+
install: node_modules
52+
53+
# Remove temporary files and build artifacts.
54+
clean:
55+
rm -rf *.log coverage
56+
.PHONY: clean
57+
58+
# Remove temporary files, build artifacts, and vendor dependencies.
59+
distclean: clean
60+
rm -rf node_modules
61+
.PHONY: distclean
62+
63+
# Lint JavaScript source files.
64+
lint: install
65+
@$(ESLINT) $(ALL_FILES)
66+
.PHONY: lint
67+
68+
# Attempt to fix linting errors.
69+
fmt: install
70+
@$(ESLINT) --fix $(ALL_FILES)
71+
.PHONY: fmt
72+
73+
# Run browser unit tests in a browser.
74+
test-browser: install
75+
@$(KARMA) start $(KARMA_FLAGS) $(KARMA_CONF)
76+
77+
# Default test target.
78+
test: lint test-browser
79+
.PHONY: test
80+
.DEFAULT_GOAL = test
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[![Build Status][ci-badge]][ci-link]
2+
# analytics.js-integration-kenshoo-infinity
3+
4+
Kenshoo Infinity Tag integration for [Analytics.js][].
5+
6+
## License
7+
8+
Released under the [MIT license](LICENSE).
9+
10+
11+
[Analytics.js]: https://segment.com/docs/libraries/analytics.js/
12+
[ci-link]: https://ci.segment.com/gh/segment-integrations/analytics.js-integration-kenshoo-infinity
13+
[ci-badge]: https://ci.segment.com/gh/segment-integrations/analytics.js-integration-kenshoo-infinity.svg?style=svg
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/* eslint-env node */
2+
'use strict';
3+
4+
var baseConfig = require('./karma.conf');
5+
6+
var customLaunchers = {
7+
sl_chrome_latest: {
8+
base: 'SauceLabs',
9+
browserName: 'chrome',
10+
platform: 'linux',
11+
version: 'latest'
12+
},
13+
sl_chrome_latest_1: {
14+
base: 'SauceLabs',
15+
browserName: 'chrome',
16+
platform: 'linux',
17+
version: 'latest-1'
18+
},
19+
sl_firefox_latest: {
20+
base: 'SauceLabs',
21+
browserName: 'firefox',
22+
platform: 'linux',
23+
version: 'latest'
24+
},
25+
sl_firefox_latest_1: {
26+
base: 'SauceLabs',
27+
browserName: 'firefox',
28+
platform: 'linux',
29+
version: 'latest-1'
30+
},
31+
sl_safari_9: {
32+
base: 'SauceLabs',
33+
browserName: 'safari',
34+
version: '9.0'
35+
},
36+
// (han) partner script doesn't support these so yeah
37+
// sl_ie_7: {
38+
// base: 'saucelabs',
39+
// browsername: 'internet explorer',
40+
// version: '7'
41+
// },
42+
// sl_ie_8: {
43+
// base: 'SauceLabs',
44+
// browserName: 'internet explorer',
45+
// version: '8'
46+
// },
47+
sl_ie_9: {
48+
base: 'SauceLabs',
49+
browserName: 'internet explorer',
50+
version: '9'
51+
},
52+
sl_ie_10: {
53+
base: 'SauceLabs',
54+
browserName: 'internet explorer',
55+
version: '10'
56+
},
57+
sl_ie_11: {
58+
base: 'SauceLabs',
59+
browserName: 'internet explorer',
60+
version: '11'
61+
},
62+
sl_edge_latest: {
63+
base: 'SauceLabs',
64+
browserName: 'microsoftedge'
65+
}
66+
};
67+
68+
module.exports = function(config) {
69+
baseConfig(config);
70+
71+
if (!process.env.SAUCE_USERNAME || !process.env.SAUCE_ACCESS_KEY) {
72+
throw new Error('SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables are required but are missing');
73+
}
74+
75+
config.set({
76+
browserDisconnectTolerance: 1,
77+
78+
singleRun: true,
79+
80+
reporters: ['progress', 'junit', 'coverage'],
81+
82+
browsers: ['PhantomJS'].concat(Object.keys(customLaunchers)),
83+
84+
customLaunchers: customLaunchers,
85+
86+
junitReporter: {
87+
outputDir: process.env.TEST_REPORTS_DIR,
88+
suite: require('./package.json').name
89+
},
90+
91+
sauceLabs: {
92+
testName: require('./package.json').name
93+
},
94+
95+
coverageReporter: {
96+
reporters: [
97+
{ type: 'lcov' }
98+
]
99+
}
100+
});
101+
};
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* eslint-env node */
2+
'use strict';
3+
4+
module.exports = function(config) {
5+
config.set({
6+
files: [
7+
'test/**/*.test.js'
8+
],
9+
10+
browsers: ['PhantomJS'],
11+
12+
frameworks: ['browserify', 'mocha'],
13+
14+
reporters: ['spec', 'coverage'],
15+
16+
preprocessors: {
17+
'test/**/*.js': 'browserify'
18+
},
19+
20+
client: {
21+
mocha: {
22+
grep: process.env.GREP,
23+
reporter: 'html',
24+
timeout: 10000
25+
}
26+
},
27+
28+
browserify: {
29+
debug: true,
30+
transform: [
31+
[
32+
'browserify-istanbul',
33+
{
34+
instrumenterConfig: {
35+
embedSource: true
36+
}
37+
}
38+
]
39+
]
40+
},
41+
42+
coverageReporter: {
43+
reporters: [
44+
{ type: 'text' },
45+
{ type: 'html' },
46+
{ type: 'json' }
47+
]
48+
}
49+
});
50+
};

0 commit comments

Comments
 (0)