Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
techweb_cci
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ESTELLON Bertrand
techweb_cci
Commits
5268bb10
Commit
5268bb10
authored
7 months ago
by
ESTELLON Bertrand
Browse files
Options
Downloads
Patches
Plain Diff
Correction des tests du TD45
parent
f0b5c246
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
TD45/all.test.js
+7
-1
7 additions, 1 deletion
TD45/all.test.js
with
7 additions
and
1 deletion
TD45/all.test.js
+
7
−
1
View file @
5268bb10
...
@@ -69,7 +69,11 @@ if (progression >= 27) {
...
@@ -69,7 +69,11 @@ if (progression >= 27) {
const
browser
=
await
puppeteer
.
launch
();
const
browser
=
await
puppeteer
.
launch
();
const
page
=
await
browser
.
newPage
();
const
page
=
await
browser
.
newPage
();
const
consoleLogs
=
[];
const
consoleLogs
=
[];
page
.
on
(
'
console
'
,
async
consoleObj
=>
{
consoleLogs
.
push
(
await
consoleObj
.
args
()[
0
]?.
jsonValue
())
});
page
.
on
(
'
console
'
,
async
consoleObj
=>
{
const
line
=
await
consoleObj
.
args
()[
0
]?.
jsonValue
();
if
(
line
==
undefined
)
return
;
consoleLogs
.
push
(
line
)
});
await
page
.
goto
(
`http://localhost:
${
fastify
.
server
.
address
().
port
}
`
);
await
page
.
goto
(
`http://localhost:
${
fastify
.
server
.
address
().
port
}
`
);
const
content
=
await
page
.
content
();
const
content
=
await
page
.
content
();
const
dom
=
new
JSDOM
(
content
);
const
dom
=
new
JSDOM
(
content
);
...
@@ -96,6 +100,7 @@ if (progression >= 28 && progression < 30) {
...
@@ -96,6 +100,7 @@ if (progression >= 28 && progression < 30) {
const
args
=
consoleObj
.
args
();
const
args
=
consoleObj
.
args
();
const
arg0
=
args
[
0
];
const
arg0
=
args
[
0
];
const
json
=
await
arg0
.
jsonValue
();
const
json
=
await
arg0
.
jsonValue
();
if
(
json
==
undefined
)
return
;
consoleLogs
.
push
(
json
)
consoleLogs
.
push
(
json
)
});
});
await
page
.
goto
(
`http://localhost:
${
fastify
.
server
.
address
().
port
}
`
);
await
page
.
goto
(
`http://localhost:
${
fastify
.
server
.
address
().
port
}
`
);
...
@@ -122,6 +127,7 @@ if (progression == 29) {
...
@@ -122,6 +127,7 @@ if (progression == 29) {
const
args
=
consoleObj
.
args
();
const
args
=
consoleObj
.
args
();
const
arg0
=
args
[
0
];
const
arg0
=
args
[
0
];
const
json
=
await
arg0
.
jsonValue
();
const
json
=
await
arg0
.
jsonValue
();
if
(
json
==
undefined
)
return
;
consoleLogs
.
push
(
json
)
consoleLogs
.
push
(
json
)
});
});
await
page
.
goto
(
`http://localhost:
${
fastify
.
server
.
address
().
port
}
`
);
await
page
.
goto
(
`http://localhost:
${
fastify
.
server
.
address
().
port
}
`
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment