Skip to content

Commit

Permalink
chore: rm content type hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F authored May 30, 2024
1 parent 1986c95 commit b57c792
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
14 changes: 3 additions & 11 deletions test/consumer.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ const { expect } = chai;

const HOST = '127.0.0.1';

const isWin = process.platform === 'win32';
const isDarwinArm64 = process.platform === 'darwin' && process.arch === 'arm64';
const usesOctetStream = isWin || isDarwinArm64;

describe('FFI integration test for the HTTP Consumer API', () => {
setLogLevel('trace');

Expand Down Expand Up @@ -75,9 +71,7 @@ describe('FFI integration test for the HTTP Consumer API', () => {
.request({
baseURL: `http://${HOST}:${port}`,
headers: {
'content-type': usesOctetStream
? 'application/octet-stream'
: 'application/gzip',
'content-type': 'application/gzip',
Accept: 'application/json',
'x-special-header': 'header',
},
Expand Down Expand Up @@ -195,7 +189,7 @@ describe('FFI integration test for the HTTP Consumer API', () => {
interaction.withQuery('someParam', 0, 'someValue');
interaction.withRequestBinaryBody(
bytes,
usesOctetStream ? 'application/octet-stream' : 'application/gzip'
'application/gzip'
);
interaction.withResponseBody(
JSON.stringify({
Expand All @@ -218,9 +212,7 @@ describe('FFI integration test for the HTTP Consumer API', () => {
.request({
baseURL: `http://${HOST}:${port}`,
headers: {
'content-type': usesOctetStream
? 'application/octet-stream'
: 'application/gzip',
'content-type': 'application/gzip',
Accept: 'application/json',
'x-special-header': 'header',
},
Expand Down
5 changes: 1 addition & 4 deletions test/message.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ import { setLogLevel } from '../src/logger';
chai.use(chaiAsPromised);
const { expect } = chai;

const isWin = process.platform === 'win32';
const isDarwinArm64 = process.platform === 'darwin' && process.arch === 'arm64';
const usesOctetStream = isWin || isDarwinArm64;

const getFeature = async (address: string, protoFile: string) => {
const def = await load(protoFile);
Expand Down Expand Up @@ -100,7 +97,7 @@ describe('FFI integration test for the Message Consumer API', () => {
message.givenWithParam('some state 2', 'state2 key', 'state2 val');
message.withBinaryContents(
bytes,
usesOctetStream ? 'application/octet-stream' : 'application/gzip'
'application/gzip'
);
message.withMetadata('meta-key', 'meta-val');

Expand Down

0 comments on commit b57c792

Please sign in to comment.