0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 17:34:47 -05:00

docs: update testing module url (#1459)

This commit is contained in:
木杉 2019-01-04 18:11:58 +08:00 committed by Ryan Dahl
parent ea6c9f2f36
commit ad01085406

12
Docs.md
View file

@ -145,7 +145,7 @@ browser JavaScript, Deno can import libraries directly from URLs. This example
uses a URL to import a test runner library: uses a URL to import a test runner library:
```ts ```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() { test(function t1() {
assertEqual("hello", "hello"); assertEqual("hello", "hello");
@ -161,10 +161,8 @@ Try running this:
``` ```
> deno https://deno.land/x/examples/example_test.ts > deno https://deno.land/x/examples/example_test.ts
Compiling /Users/rld/src/deno_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/mod.ts
Downloading https://deno.land/x/testing/util.ts Compiling https://deno.land/x/testing/mod.ts
Compiling https://deno.land/x/testing/testing.ts
Compiling https://deno.land/x/testing/util.ts
running 2 tests running 2 tests
test t1 test t1
... ok ... 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 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 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 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: `package.ts` file the exports the third-party code:
```ts ```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 And throughout project one can import from the `package.ts` and avoid having