Skip to content

Commit ef301f8

Browse files
authored
Updated api key for integrated test - bump dev deps (#194)
* Updated api key for integrated test - bump dev deps * Removed env-cmd from test script * Added missing env for matrix tests
1 parent ec13d9d commit ef301f8

File tree

8 files changed

+24
-10
lines changed

8 files changed

+24
-10
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
patreon: switcherapi
2+
ko_fi: petruki
3+
github: [petruki]

.github/workflows/master.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
- run: npm install
2626
- run: npm run lint
2727
- run: npm test
28+
env:
29+
SWITCHER_API_KEY: ${{ secrets.SWITCHER_API_KEY }}
2830

2931
- name: SonarCloud Scan
3032
uses: sonarsource/sonarcloud-github-action@master
@@ -53,3 +55,5 @@ jobs:
5355

5456
- run: npm install
5557
- run: npm test
58+
env:
59+
SWITCHER_API_KEY: ${{ secrets.SWITCHER_API_KEY }}

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ jobs:
1616
node-version: 20
1717
- run: npm install
1818
- run: npm test
19+
env:
20+
SWITCHER_API_KEY: ${{ secrets.SWITCHER_API_KEY }}
1921

2022
publish-npm:
2123
name: Publish to NPM

.github/workflows/staging.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,6 @@ jobs:
3030
node-version: ${{ github.event.inputs.node }}
3131

3232
- run: npm install
33-
- run: npm test
33+
- run: npm test
34+
env:
35+
SWITCHER_API_KEY: ${{ secrets.SWITCHER_API_KEY }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ coverage.html
88
coverage
99
.nyc_output
1010
package-lock.json
11-
dist
11+
dist
12+
.env

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,26 @@
2020
"scripts": {
2121
"lint": "eslint ./src/**/*.js ./test/**/*.js",
2222
"test": "npm run coverage \"./test/**/*.test.js\"",
23+
"test-local": "env-cmd npm run coverage \"./test/**/*.test.js\"",
2324
"coverage": "c8 --include='src/**/*.js' mocha",
24-
"play": "node ./test/playground/index.js"
25+
"play": "env-cmd node ./test/playground/index.js"
2526
},
2627
"files": [
2728
"LICENSE",
2829
"switcher-client.js",
2930
"src/"
3031
],
3132
"devDependencies": {
32-
"@babel/eslint-parser": "^7.25.1",
33-
"@typescript-eslint/eslint-plugin": "^8.4.0",
34-
"@typescript-eslint/parser": "^8.4.0",
33+
"@babel/eslint-parser": "^7.25.8",
34+
"@typescript-eslint/eslint-plugin": "^8.10.0",
35+
"@typescript-eslint/parser": "^8.10.0",
3536
"c8": "^10.1.2",
3637
"chai": "^5.1.1",
37-
"eslint": "^9.10.0",
38+
"env-cmd": "^10.1.0",
39+
"eslint": "^9.13.0",
3840
"mocha": "^10.7.3",
3941
"mocha-sonarqube-reporter": "^1.0.2",
40-
"sinon": "^18.0.0"
42+
"sinon": "^19.0.2"
4143
},
4244
"repository": {
4345
"type": "git",

test/playground/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Client } from '../../switcher-client.js';
22
import { sleep } from '../helper/utils.js';
33

44
const SWITCHER_KEY = 'MY_SWITCHER';
5-
const apiKey = 'JDJiJDA4JEFweTZjSTR2bE9pUjNJOUYvRy9raC4vRS80Q2tzUnk1d3o1aXFmS2o5eWJmVW11cjR0ODNT';
5+
const apiKey = process.env.SWITCHER_API_KEY;
66
const domain = 'Playground';
77
const component = 'switcher-playground';
88
const environment = 'default';

test/switcher-integrated.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ describe('Switcher integrated test', () => {
1010
// given context build
1111
Client.buildContext({
1212
url: 'https://api.switcherapi.com',
13-
apiKey: 'JDJiJDA4JEFweTZjSTR2bE9pUjNJOUYvRy9raC4vRS80Q2tzUnk1d3o1aXFmS2o5eWJmVW11cjR0ODNT',
13+
apiKey: process.env.SWITCHER_API_KEY,
1414
domain: 'Playground',
1515
component: 'switcher-playground'
1616
});

0 commit comments

Comments
 (0)