@letscooee/web-sdk 0.3.1 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/sdk-preview.min.js +1 -1
- package/dist/sdk.min.js +1 -1
- package/karma.conf.js +87 -0
- package/package.json +13 -2
package/karma.conf.js
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// Karma configuration file, see link for more information
|
|
2
|
+
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
|
3
|
+
const testCode = 'src/**/*.spec.ts';
|
|
4
|
+
|
|
5
|
+
module.exports = function (config) {
|
|
6
|
+
config.set({
|
|
7
|
+
basePath: '',
|
|
8
|
+
frameworks: ['jasmine', 'webpack'],
|
|
9
|
+
plugins: [
|
|
10
|
+
require('karma-jasmine'),
|
|
11
|
+
require('karma-chrome-launcher'),
|
|
12
|
+
require('karma-jasmine-html-reporter'),
|
|
13
|
+
require('karma-junit-reporter'),
|
|
14
|
+
require('karma-coverage'),
|
|
15
|
+
require('karma-webpack'),
|
|
16
|
+
],
|
|
17
|
+
files: [
|
|
18
|
+
testCode,
|
|
19
|
+
],
|
|
20
|
+
client: {
|
|
21
|
+
jasmine: {
|
|
22
|
+
// you can add configuration options for Jasmine here
|
|
23
|
+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
|
|
24
|
+
// for example, you can disable the random execution with `random: false`
|
|
25
|
+
// or set a specific seed with `seed: 4321`
|
|
26
|
+
},
|
|
27
|
+
clearContext: false // leave Jasmine Spec Runner output visible in browser
|
|
28
|
+
},
|
|
29
|
+
jasmineHtmlReporter: {
|
|
30
|
+
suppressAll: true // removes the duplicated traces
|
|
31
|
+
},
|
|
32
|
+
junitReporter: {
|
|
33
|
+
outputDir: './tmp/test-reports',
|
|
34
|
+
useBrowserName: true,
|
|
35
|
+
},
|
|
36
|
+
coverageReporter: {
|
|
37
|
+
dir: require('path').join(__dirname, './tmp/coverage'),
|
|
38
|
+
subdir: '.',
|
|
39
|
+
reporters: [
|
|
40
|
+
{type: 'html'},
|
|
41
|
+
{type: 'cobertura'},
|
|
42
|
+
{type: 'text-summary'}
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
preprocessors: {
|
|
46
|
+
[testCode]: ['webpack', 'coverage'],
|
|
47
|
+
},
|
|
48
|
+
reporters: ['progress', 'kjhtml'],
|
|
49
|
+
port: 9876,
|
|
50
|
+
colors: true,
|
|
51
|
+
logLevel: config.LOG_INFO,
|
|
52
|
+
autoWatch: true,
|
|
53
|
+
browsers: ['ChromeHeadlessNoSandbox'],
|
|
54
|
+
customLaunchers: {
|
|
55
|
+
// https://github.com/karma-runner/karma-chrome-launcher/issues/158#issuecomment-339265457
|
|
56
|
+
ChromeHeadlessNoSandbox: {
|
|
57
|
+
base: 'ChromeHeadless',
|
|
58
|
+
flags: ['--no-sandbox']
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
singleRun: true,
|
|
62
|
+
restartOnFileChange: true,
|
|
63
|
+
webpack: {
|
|
64
|
+
target: ['web'],
|
|
65
|
+
module: {
|
|
66
|
+
rules: [
|
|
67
|
+
{
|
|
68
|
+
test: /\.tsx?$/,
|
|
69
|
+
use: 'ts-loader',
|
|
70
|
+
exclude: /node_modules/,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
resolve: {
|
|
75
|
+
extensions: ['.tsx', '.ts', '.js'],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
if (process.env.GITLAB_CI) {
|
|
81
|
+
process.env.CHROME_BIN = '/usr/bin/google-chrome-stable';
|
|
82
|
+
console.log('ChromeHeadless path', process.env.CHROME_BIN);
|
|
83
|
+
config.browsers = ['ChromeHeadlessNoSandbox'];
|
|
84
|
+
|
|
85
|
+
config.reporters.push('junit');
|
|
86
|
+
}
|
|
87
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@letscooee/web-sdk",
|
|
3
3
|
"description": "AI driven Personalized Notifications for Better Customer Engagement",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "eslint 'src/**'",
|
|
7
7
|
"integrity": "./scripts/validate-integrity.sh",
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
"serve:preview": "webpack serve --config ./webpack-preview.config.js",
|
|
13
13
|
"preversion": "git add CHANGELOG.md src/constants.ts",
|
|
14
14
|
"version": "npm run build:production",
|
|
15
|
-
"postversion": "git push && git push --tags"
|
|
15
|
+
"postversion": "git push && git push --tags",
|
|
16
|
+
"test": "karma start --no-auto-watch",
|
|
17
|
+
"test:ci": "karma start --no-auto-watch --code-coverage=true"
|
|
16
18
|
},
|
|
17
19
|
"repository": {
|
|
18
20
|
"type": "git",
|
|
@@ -31,11 +33,20 @@
|
|
|
31
33
|
},
|
|
32
34
|
"homepage": "https://github.com/letscooee/cooee-web-sdk#readme",
|
|
33
35
|
"devDependencies": {
|
|
36
|
+
"@types/jasmine": "^4.3.1",
|
|
34
37
|
"@types/ua-parser-js": "^0.7.36",
|
|
35
38
|
"@typescript-eslint/eslint-plugin": "^5.10.0",
|
|
36
39
|
"@typescript-eslint/parser": "^5.10.0",
|
|
37
40
|
"eslint": "^8.7.0",
|
|
38
41
|
"eslint-config-google": "^0.14.0",
|
|
42
|
+
"jasmine-core": "^4.5.0",
|
|
43
|
+
"karma": "^6.4.1",
|
|
44
|
+
"karma-chrome-launcher": "^3.1.1",
|
|
45
|
+
"karma-coverage": "^2.2.0",
|
|
46
|
+
"karma-jasmine": "^5.1.0",
|
|
47
|
+
"karma-jasmine-html-reporter": "^2.0.0",
|
|
48
|
+
"karma-junit-reporter": "^2.0.1",
|
|
49
|
+
"karma-webpack": "^5.0.0",
|
|
39
50
|
"ts-loader": "^9.2.4",
|
|
40
51
|
"typescript": "^4.4.4",
|
|
41
52
|
"webpack": "^5.47.1",
|