Skip to content

Commit 599bb78

Browse files
committed
fix: testing ts-binary-wrapper separately from CLI-specific tests
1 parent 8768deb commit 599bb78

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.circleci/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,9 @@ jobs:
12471247
CC: << parameters.c_compiler >>
12481248
CGO_ENABLED: 1
12491249
command: make << parameters.make_target >> GOOS=<< parameters.go_target_os >> GOARCH=<< parameters.go_arch >>
1250+
- run:
1251+
name: Create a shasum file of the Snyk binary
1252+
command: find binary-releases -name "snyk-*" -exec make {}.sha256 \;
12501253
- save_cache:
12511254
key: go-build-{{ arch }}-{{ checksum "cliv2/go.sum" }}
12521255
paths: [/home/circleci/go/pkg/mod]
@@ -1305,6 +1308,10 @@ jobs:
13051308
go_arch: << parameters.go_arch >>
13061309
base_url: << parameters.go_download_base_url >>
13071310
extraction_path: << parameters.install_path >>
1311+
- run:
1312+
working_directory: ./ts-binary-wrapper
1313+
name: Building and testing the TS-Binary-Wrapper
1314+
command: npm install --ignore-scripts && npm run build && npm run test
13081315
- run:
13091316
name: Running acceptance tests
13101317
no_output_timeout: 30m

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ $(BINARY_WRAPPER_DIR)/src/generated/sha256sums.txt:
187187
.PHONY: build-binary-wrapper
188188
build-binary-wrapper: pre-build-binary-wrapper $(BINARY_WRAPPER_DIR)/src/generated/version $(BINARY_WRAPPER_DIR)/src/generated/sha256sums.txt
189189
@echo "-- Building Typescript Binary Wrapper ($(BINARY_WRAPPER_DIR)/dist/)"
190-
@cd $(BINARY_WRAPPER_DIR); npm run build
190+
@cd $(BINARY_WRAPPER_DIR); npm install --ignore-scripts && npm run build
191191

192192
.PHONY: clean-binary-wrapper
193193
clean-binary-wrapper:
@@ -199,6 +199,7 @@ clean-binary-wrapper:
199199
@rm -rf $(BINARY_WRAPPER_DIR)/src/generated
200200
@rm -rf $(BINARY_WRAPPER_DIR)/help
201201
@rm -rf $(BINARY_WRAPPER_DIR)/pysrc
202+
@rm -rf $(BINARY_WRAPPER_DIR)/wrapper_dist
202203
@cd $(BINARY_WRAPPER_DIR); npm run clean
203204

204205
.PHONY: pre-build-binary-wrapper

test/createJestConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const createJestConfig = (config) => {
77
'<rootDir>/test/tap/',
88
'<rootDir>/packages/',
99
'<rootDir>/pysrc/',
10+
'<rootDir>/ts-binary-wrapper/',
1011
];
1112

1213
return {

ts-binary-wrapper/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"extends": "../tsconfig.settings.json",
33
"compilerOptions": {
44
"outDir": "./wrapper_dist",
5-
"rootDir": "./src"
5+
"rootDir": "./src",
6+
"esModuleInterop": true
67
},
78
"include": ["./src/**/*"],
89
"types": ["node", "jest"]

0 commit comments

Comments
 (0)