-
-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ADD deno support * ADD deno support * ADD docs * FIX lint * FIX test * UPDATE node * FIX check * FIX tests * CLEAR cache * PIN node version
- Loading branch information
Showing
7 changed files
with
129 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { BroadcastChannel } from '../dist/esbrowser/index.js'; | ||
import { randomString } from 'async-test-util'; | ||
import assert from 'assert'; | ||
export async function run() { | ||
|
||
console.log('--- 1'); | ||
|
||
console.dir({ | ||
// eslint-disable-next-line | ||
'globalThis.Deno': !!globalThis.Deno, | ||
// eslint-disable-next-line | ||
'globalThis.Deno.args': !!globalThis.Deno.args | ||
}); | ||
console.log('--- 2'); | ||
// eslint-disable-next-line | ||
console.log(Object.keys(Deno).sort().join(', ')); | ||
|
||
console.log('--- 3'); | ||
|
||
|
||
const bc = new BroadcastChannel(randomString()); | ||
console.log('bc.type: ' + bc.type); | ||
|
||
|
||
/** | ||
* Deno should use its global native BroadcastChannel | ||
* @link https://docs.deno.com/deploy/api/runtime-broadcast-channel | ||
*/ | ||
assert.strictEqual(bc.type, 'native'); | ||
|
||
await bc.postMessage({ foo: 'bar' }); | ||
await bc.close(); | ||
} | ||
run(); |