mirror of
https://github.com/denoland/deno.git
synced 2024-11-29 16:30:56 -05:00
chore: fix flaky lsp_testing_api test (#14569)
This commit is contained in:
parent
2da868bb4c
commit
e6d8775611
1 changed files with 18 additions and 1 deletions
|
@ -5470,13 +5470,30 @@ Deno.test({
|
||||||
assert!(res.is_ok());
|
assert!(res.is_ok());
|
||||||
let (method, notification) = res.unwrap();
|
let (method, notification) = res.unwrap();
|
||||||
assert_eq!(method, "deno/testRunProgress");
|
assert_eq!(method, "deno/testRunProgress");
|
||||||
|
let notification_value = notification
|
||||||
|
.as_ref()
|
||||||
|
.unwrap()
|
||||||
|
.as_object()
|
||||||
|
.unwrap()
|
||||||
|
.get("message")
|
||||||
|
.unwrap()
|
||||||
|
.as_object()
|
||||||
|
.unwrap()
|
||||||
|
.get("value")
|
||||||
|
.unwrap()
|
||||||
|
.as_str()
|
||||||
|
.unwrap();
|
||||||
|
// deno test's output capturing flushes with a zero-width space in order to
|
||||||
|
// synchronize the output pipes. Occassionally this zero width space
|
||||||
|
// might end up in the output so strip it from the output comparison here.
|
||||||
|
assert_eq!(notification_value.replace('\u{200B}', ""), "test a\r\n");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
notification,
|
notification,
|
||||||
Some(json!({
|
Some(json!({
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"message": {
|
"message": {
|
||||||
"type": "output",
|
"type": "output",
|
||||||
"value": "test a\r\n",
|
"value": notification_value,
|
||||||
"test": {
|
"test": {
|
||||||
"textDocument": {
|
"textDocument": {
|
||||||
"uri": specifier,
|
"uri": specifier,
|
||||||
|
|
Loading…
Reference in a new issue