diff options
| author | Vincent LE GOFF <g_n_s@hotmail.fr> | 2019-04-24 13:41:23 +0200 |
|---|---|---|
| committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-24 07:41:22 -0400 |
| commit | dcd01dd02530df0e799eb4227087680ffeb80d74 (patch) | |
| tree | 8cc1dec75dd17c326fea6d7fe471b7e7a31032f7 /fs/glob_test.ts | |
| parent | e1f7a60bb326f8299f339635c0738d28431afa0a (diff) | |
Eslint fixes (denoland/deno_std#356)
Make warnings fail
Original: https://github.com/denoland/deno_std/commit/4543b563a9a01c8c168aafcbfd9d4634effba7fc
Diffstat (limited to 'fs/glob_test.ts')
| -rw-r--r-- | fs/glob_test.ts | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/fs/glob_test.ts b/fs/glob_test.ts index fc3704ae3..5772373dd 100644 --- a/fs/glob_test.ts +++ b/fs/glob_test.ts @@ -20,8 +20,9 @@ async function walkArray( arr.push(f.path.replace(/\\/g, "/")); } arr.sort(); - const arrSync = Array.from(walkSync(dirname, options), (f: FileInfo) => - f.path.replace(/\\/g, "/") + const arrSync = Array.from( + walkSync(dirname, options), + (f: FileInfo): string => f.path.replace(/\\/g, "/") ).sort(); assertEquals(arr, arrSync); return arr; @@ -29,7 +30,7 @@ async function walkArray( test({ name: "glob: glob to regex", - fn() { + fn(): void { assertEquals(glob("unicorn.*") instanceof RegExp, true); assertEquals(glob("unicorn.*").test("poney.ts"), false); assertEquals(glob("unicorn.*").test("unicorn.py"), true); @@ -69,11 +70,11 @@ test({ }); testWalk( - async (d: string) => { + async (d: string): Promise<void> => { await mkdir(d + "/a"); await touch(d + "/a/x.ts"); }, - async function globInWalk() { + async function globInWalk(): Promise<void> { const arr = await walkArray(".", { match: [glob("*.ts")] }); assertEquals(arr.length, 1); assertEquals(arr[0], "./a/x.ts"); @@ -81,14 +82,14 @@ testWalk( ); testWalk( - async (d: string) => { + async (d: string): Promise<void> => { await mkdir(d + "/a"); await mkdir(d + "/b"); await touch(d + "/a/x.ts"); await touch(d + "/b/z.ts"); await touch(d + "/b/z.js"); }, - async function globInWalkWildcardFiles() { + async function globInWalkWildcardFiles(): Promise<void> { const arr = await walkArray(".", { match: [glob("*.ts")] }); assertEquals(arr.length, 2); assertEquals(arr[0], "./a/x.ts"); @@ -97,12 +98,12 @@ testWalk( ); testWalk( - async (d: string) => { + async (d: string): Promise<void> => { await mkdir(d + "/a"); await mkdir(d + "/a/yo"); await touch(d + "/a/yo/x.ts"); }, - async function globInWalkFolderWildcard() { + async function globInWalkFolderWildcard(): Promise<void> { const arr = await walkArray(".", { match: [ glob(join("a", "**", "*.ts"), { @@ -117,7 +118,7 @@ testWalk( ); testWalk( - async (d: string) => { + async (d: string): Promise<void> => { await mkdir(d + "/a"); await mkdir(d + "/a/unicorn"); await mkdir(d + "/a/deno"); @@ -126,7 +127,7 @@ testWalk( await touch(d + "/a/deno/x.ts"); await touch(d + "/a/unicorn/x.ts"); }, - async function globInWalkFolderExtended() { + async function globInWalkFolderExtended(): Promise<void> { const arr = await walkArray(".", { match: [ glob(join("a", "+(raptor|deno)", "*.ts"), { @@ -142,12 +143,12 @@ testWalk( ); testWalk( - async (d: string) => { + async (d: string): Promise<void> => { await touch(d + "/x.ts"); await touch(d + "/x.js"); await touch(d + "/b.js"); }, - async function globInWalkWildcardExtension() { + async function globInWalkWildcardExtension(): Promise<void> { const arr = await walkArray(".", { match: [glob("x.*", { flags: "g", globstar: true })] }); |
