Commit 958b4d25 authored by Renato Figueiro Maia's avatar Renato Figueiro Maia
Browse files

Evitar problemas com o uso do 'jasmine-matchers'.

[SOMA-6916][SOMA-6857]
parent 800fca0d
Pipeline #69213 passed with stages
in 4 minutes and 34 seconds
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"express": "^4.17.1", "express": "^4.17.1",
"jasmine": "^3.6.3", "jasmine": "^3.6.3",
"jasmine-expect": "^5.0.0",
"prettier": "^2.2.1" "prettier": "^2.2.1"
} }
} }
...@@ -212,7 +212,7 @@ describe("Registered SGA", function () { ...@@ -212,7 +212,7 @@ describe("Registered SGA", function () {
[regReq] = await events.once(regMockup.events, "register"); [regReq] = await events.once(regMockup.events, "register");
// TODO: why 'jasmine-expect' matchers are not available here? // TODO: why 'jasmine-expect' matchers are not available here?
// utils.checkRegistration(regReq, config); utils.checkRegistration(regReq, config);
}); });
afterAll(utils.clearAllResources); afterAll(utils.clearAllResources);
......
...@@ -321,16 +321,17 @@ async function clearAllResources() { ...@@ -321,16 +321,17 @@ async function clearAllResources() {
function checkRegistration(req, config) { function checkRegistration(req, config) {
const body = req.body; const body = req.body;
const uriPattern = /http:\/\//;
expect(body.name).toBe(config.sga_name); expect(body.name).toBe(config.sga_name);
expect(body.type).toBe("machine"); expect(body.type).toBe("machine");
expect(body.platform).toBe(config.platform); expect(body.platform).toBe(config.platform);
expect(body.project_root_dir).toBe(config.project_root_dir); expect(body.project_root_dir).toBe(config.project_root_dir);
expect(body.algorithm_root_dir).toBe(config.algorithm_root_dir); expect(body.algorithm_root_dir).toBe(config.algorithm_root_dir);
expect(body.sandbox_root_dir).toBe(config.sandbox_root_dir); expect(body.sandbox_root_dir).toBe(config.sandbox_root_dir);
expect(body.actions.path).toBeString(); expect(body.actions.path).toMatch(uriPattern);
expect(body.actions.paths).toBeString(); expect(body.actions.paths).toMatch(uriPattern);
expect(body.actions.job).toBeString(); expect(body.actions.job).toMatch(uriPattern);
expect(body.actions.shutdown).toBeString(); expect(body.actions.shutdown).toMatch(uriPattern);
expect(body.resources).toEqual(jasmine.objectContaining(config.resources)); expect(body.resources).toEqual(jasmine.objectContaining(config.resources));
expect(body.extra_config).toEqual( expect(body.extra_config).toEqual(
jasmine.objectContaining(config.extra_config) jasmine.objectContaining(config.extra_config)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment