Skip to content

Commit

Permalink
docs: update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
AnWeber committed Mar 23, 2023
1 parent b6e2698 commit 713f4a7
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 6.3.3 (2023-03-23)

### Fixes

- allow async/await syntax in code snippets (#398)
- unable to use variable as graphql input (#421)

## 6.3.2 (2023-03-17)

### Fixes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"publisher": "AnWeber",
"description": "HTTP/REST CLI Client for *.http files",
"version": "6.3.2",
"version": "6.3.3",
"homepage": "https://github.com/AnWeber/httpyac",
"repository": {
"type": "git",
Expand Down
30 changes: 30 additions & 0 deletions src/test/scripts/javascript.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { initFileProvider, sendHttp } from '../testUtils';
import { getLocal } from 'mockttp';

describe('scripts.javascript', () => {
const localServer = getLocal();
beforeEach(() => localServer.start());
afterEach(() => localServer.stop());

it('basic auth', async () => {
initFileProvider();
const mockedEndpoints = await localServer.forGet('/json').thenJson(200, { foo: 'bar', test: 1 });

await sendHttp(`
{{
//pre request script
const crypto = require('crypto');
const date = new Date();
const signatureBase64 = crypto.createHmac('sha256', 'secret')
.update(\`\${request.method}\u2028\${request.url}\`).digest("base64");
exports.authentcation = \`Basic \${signatureBase64}\`;
}}
GET http://localhost:${localServer.port}/json
authorization: {{authentcation}}
`);

const requests = await mockedEndpoints.getSeenRequests();
expect(requests[0].headers.authorization).toBe('Basic H9PPJrcxbDVji+d8UTU7Yr5bYn+MEZwW3Y2NPmgQI0Q=');
});
});

0 comments on commit 713f4a7

Please sign in to comment.