Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
timothe
duniter
Commits
d37aa060
Commit
d37aa060
authored
Nov 08, 2018
by
Cédric Moreau
Browse files
[enh] Also export Test tools
parent
e7da47ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
index.ts
View file @
d37aa060
...
...
@@ -614,3 +614,5 @@ export const Duniter = {
}
}
export
*
from
'
./test/unit-tools
'
export
*
from
'
./test/integration/tools/toolbox
'
test/integration/tools/http-expect.ts
View file @
d37aa060
...
...
@@ -59,7 +59,7 @@ export async function expectJSON<T>(promise:Promise<T>, json:any) {
try
{
const
resJson
=
await
promise
;
Underscore
.
keys
(
json
).
forEach
(
function
(
key
){
resJson
.
should
.
have
.
property
(
String
(
key
)).
equal
(
json
[
key
]);
(
resJson
as
any
)
.
should
.
have
.
property
(
String
(
key
)).
equal
(
json
[
key
]);
});
}
catch
(
err
)
{
if
(
err
.
response
)
{
...
...
test/unit-tools.ts
View file @
d37aa060
...
...
@@ -12,6 +12,7 @@
// GNU Affero General Public License for more details.
import
*
as
assert
from
'
assert
'
const
should
=
require
(
'
should
'
)
export
async
function
shouldThrow
(
promise
:
Promise
<
any
>
)
{
let
error
=
false
...
...
@@ -20,8 +21,8 @@ export async function shouldThrow(promise:Promise<any>) {
}
catch
(
e
)
{
error
=
true
}
promise
.
should
.
be
.
rejected
()
error
.
should
.
equal
(
true
)
(
promise
as
any
)
.
should
.
be
.
rejected
()
(
error
as
any
)
.
should
.
equal
(
true
)
}
export
async
function
shouldNotFail
<
T
>
(
promise
:
Promise
<
T
>
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment