test: Make helper terminology consistent.

This commit is contained in:
Ruben Verborgh
2020-12-22 01:02:19 +01:00
parent 9dcb4fb603
commit af8524e0d6
7 changed files with 129 additions and 109 deletions

View File

@@ -1,12 +1,12 @@
import type { MockResponse } from 'node-mocks-http';
import type { HttpHandler, Initializer, ResourceStore } from '../../src/';
import { AclTestHelper } from '../util/TestHelpers';
import { call } from '../util/Util';
import { AclHelper } from '../util/TestHelpers';
import { performRequest } from '../util/Util';
import { BASE, instantiateFromConfig } from './Config';
describe('A server with authorization', (): void => {
let handler: HttpHandler;
let aclHelper: AclTestHelper;
let aclHelper: AclHelper;
beforeAll(async(): Promise<void> => {
// Set up the internal store
@@ -32,7 +32,7 @@ describe('A server with authorization', (): void => {
await initializer.handleSafe();
// Create test helpers for manipulating the components
aclHelper = new AclTestHelper(store, BASE);
aclHelper = new AclHelper(store, BASE);
});
it('can create new entries.', async(): Promise<void> => {
@@ -40,7 +40,7 @@ describe('A server with authorization', (): void => {
// POST
let requestUrl = new URL('http://test.com/');
let response: MockResponse<any> = await call(
let response: MockResponse<any> = await performRequest(
handler,
requestUrl,
'POST',
@@ -51,7 +51,7 @@ describe('A server with authorization', (): void => {
// PUT
requestUrl = new URL('http://test.com/foo/bar');
response = await call(
response = await performRequest(
handler,
requestUrl,
'PUT',
@@ -66,7 +66,7 @@ describe('A server with authorization', (): void => {
// POST
let requestUrl = new URL('http://test.com/');
let response: MockResponse<any> = await call(
let response: MockResponse<any> = await performRequest(
handler,
requestUrl,
'POST',
@@ -77,7 +77,7 @@ describe('A server with authorization', (): void => {
// PUT
requestUrl = new URL('http://test.com/foo/bar');
response = await call(
response = await performRequest(
handler,
requestUrl,
'PUT',