From ad01085406bbcb0d0d66eb3e05d4781a3aebee21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E6=9D=89?= Date: Fri, 4 Jan 2019 18:11:58 +0800 Subject: docs: update testing module url (#1459) --- Docs.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Docs.md b/Docs.md index 2709db126..ee1110832 100644 --- a/Docs.md +++ b/Docs.md @@ -145,7 +145,7 @@ browser JavaScript, Deno can import libraries directly from URLs. This example uses a URL to import a test runner library: ```ts -import { test, assertEqual } from "https://deno.land/x/testing/testing.ts"; +import { test, assertEqual } from "https://deno.land/x/testing/mod.ts"; test(function t1() { assertEqual("hello", "hello"); @@ -161,10 +161,8 @@ Try running this: ``` > deno https://deno.land/x/examples/example_test.ts Compiling /Users/rld/src/deno_examples/example_test.ts -Downloading https://deno.land/x/testing/testing.ts -Downloading https://deno.land/x/testing/util.ts -Compiling https://deno.land/x/testing/testing.ts -Compiling https://deno.land/x/testing/util.ts +Downloading https://deno.land/x/testing/mod.ts +Compiling https://deno.land/x/testing/mod.ts running 2 tests test t1 ... ok @@ -202,11 +200,11 @@ everywhere in a large project?** The solution is to import and re-export your external libraries in a central `package.ts` file (which serves the same purpose as Node's `package.json` file). For example, let's say you were using the above testing library across a large project. Rather than importing -`"https://deno.land/x/testing/testing.ts"` everywhere, you could create a +`"https://deno.land/x/testing/mod.ts"` everywhere, you could create a `package.ts` file the exports the third-party code: ```ts -export { test, assertEqual } from "https://deno.land/x/testing/testing.ts"; +export { test, assertEqual } from "https://deno.land/x/testing/mod.ts"; ``` And throughout project one can import from the `package.ts` and avoid having -- cgit v1.2.3