Skip to content

Commit 6e5275c

Browse files
committed
Add conformance test coverage
1 parent 410c0f4 commit 6e5275c

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

.github/workflows/conformance.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ jobs:
4545
- name: Install conformance client
4646
uses: GoogleCloudPlatform/functions-framework-conformance/.github/actions/client/install@5f2a796b58f099d749e70ecc83f531f6701c64af # v1.8.3
4747
with:
48-
client-version: v1.7.0
48+
client-version: v1.8.3
4949
cache-path: ~/client
50-
cache-key: conformance-client-v1.7.0
50+
cache-key: conformance-client-v1.8.3
5151

5252
- name: Run HTTP conformance tests using legacy API
5353
working-directory: 'test/conformance'
@@ -82,6 +82,16 @@ jobs:
8282
-validate-mapping=false \
8383
-cmd="npm start -- --target=writeHttpDeclarative"
8484
85+
- name: Run Typed conformance tests using declarative API
86+
working-directory: 'test/conformance'
87+
run: |
88+
~/client \
89+
-type=http \
90+
-declarative-type=typed \
91+
-buildpacks=false \
92+
-validate-mapping=false \
93+
-cmd="npm start -- --target=writeTypedDeclarative"
94+
8595
- name: Run cloudevent conformance tests using declarative API
8696
working-directory: 'test/conformance'
8797
run: |

src/functions.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ export class JsonInvocationFormat<T, U> implements InvocationFormat<T, U> {
206206
deserializeRequest(request: InvocationRequest): T {
207207
const body = request.body();
208208
if (typeof body !== 'string') {
209-
console.log(typeof body);
210209
throw new Error('Unsupported Content-Type, expected application/json');
211210
}
212211
try {

test/conformance/function.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ functions.http('writeHttpDeclarative', (req, res) => {
88
res.sendStatus(200);
99
});
1010

11+
functions.typed('writeTypedDeclarative', req => {
12+
return {
13+
payload: req,
14+
};
15+
});
16+
1117
functions.cloudEvent('writeCloudEventDeclarative', cloudEvent => {
1218
cloudEvent.datacontenttype = 'application/json';
1319
writeJson(cloudEvent);

0 commit comments

Comments
 (0)