test: make tests readable

This commit is contained in:
Rainer Killinger
2021-09-06 14:36:33 +02:00
parent 8dffe29146
commit cb890556d7

View File

@@ -143,7 +143,7 @@ export class MainSpec {
}
@test
checkIfContainerDoesNotMatchAnyContainer() {
'check if container does not match any container'() {
expect(containerMatchesRegex(
'anyName',
new RegExp('d+'),
@@ -152,7 +152,7 @@ export class MainSpec {
}
@test
checkIfContainerDoesNotMatchIfVersionIsIncorrect() {
'check if container does not match if version is incorrect'() {
expect(containerMatchesRegex(
'backend',
new RegExp('1\\.4\\.\\d+'),
@@ -161,7 +161,7 @@ export class MainSpec {
}
@test
checkIfContainerMatches() {
'check if container matches'() {
expect(containerMatchesRegex(
'backend',
new RegExp('1\\.0\\.\\d+'),
@@ -170,7 +170,7 @@ export class MainSpec {
}
@test
async getGatewayOfAnyContainerWithExposedPorts() {
async 'get gateway of any container with exposed ports'() {
expect(await getGatewayOfStAppsBackend(MainSpec.anyContainerWithExposedPorts)).to.be.equal('0.0.0.0:80');
}
@@ -195,7 +195,7 @@ export class MainSpec {
}
@test
async upstreamMapCallsLoggerErrorWhenNoMatchingContainerIsFound() {
async 'upstream map calls logger error when no matching container is found'() {
const spy = MainSpec.sandbox.on(console, 'error', () => {
});
@@ -214,7 +214,7 @@ export class MainSpec {
}
@test
async upstreamMapWithOneActiveVersionAndNoOutdatedOnes() {
async 'upstream map with one active version and no outdated ones'() {
expect(await generateUpstreamMap(
['1\\.0\\.\\d+'],
['0\\.8\\.\\d+'],
@@ -231,7 +231,7 @@ upstream 1__0___d_ {
}
@test
async testGetContainers() {
async 'get containers'() {
try {
await getContainers();
return false;
@@ -254,7 +254,7 @@ Please check if docker is running and Node.js can access the docker socket (/var
}
@test
async testGetTemplateView() {
async 'get template view'() {
try {
let containersWithSameVersion = [MainSpec.backendContainerWithExposedPorts, MainSpec.backendContainerWithExposedPorts];
@@ -269,7 +269,7 @@ Please check if docker is running and Node.js can access the docker socket (/var
}
@test
createListenerFaultyConfig() {
'create listener faulty config'() {
expect(generateListener({
certificate: 'faultyTest',
@@ -285,7 +285,7 @@ ${protocolHardeningParameters}
}
@test
createListenerCorrectConfig() {
'create listener correct config'() {
const testCertDir = resolve(__dirname, 'certs');
mkdirSync(testCertDir);