Skip to content
This repository has been archived by the owner on Sep 3, 2024. It is now read-only.

[Doc EN]: development-tools.md review. #263

Merged
merged 1 commit into from
Sep 28, 2017

Conversation

MachinisteWeb
Copy link
Contributor

In our French translation/review we have changed some consistent things, so we suggest you do the same in the original documentation.

More details in comments.

Do not hesitate to set back the original behavior for some changes if you think they do not make sense.

Signed-off-by: Bruno Lesieur <[email protected]>
Copy link
Contributor Author

@MachinisteWeb MachinisteWeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done for this one @atinux!

@@ -7,14 +7,15 @@ description: Nuxt.js helps you to make your web development enjoyable.

## End-to-End Testing

[Ava](https://github.com/avajs/ava) is a powerful JavaScript testing framework, mixed with [jsdom](https://github.com/tmpvar/jsdom), we can use them to do end-to-end testing easily.
[AVA](https://github.com/avajs/ava) is a powerful JavaScript testing framework, mixed with [jsdom](https://github.com/tmpvar/jsdom), we can use them to do end-to-end testing easily.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AVA is in capitalize as mentioned in official documentation
— Source: https://github.com/avajs/ava

@@ -7,14 +7,15 @@ description: Nuxt.js helps you to make your web development enjoyable.

## End-to-End Testing

[Ava](https://github.com/avajs/ava) is a powerful JavaScript testing framework, mixed with [jsdom](https://github.com/tmpvar/jsdom), we can use them to do end-to-end testing easily.
[AVA](https://github.com/avajs/ava) is a powerful JavaScript testing framework, mixed with [jsdom](https://github.com/tmpvar/jsdom), we can use them to do end-to-end testing easily.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line return like Markdown convention.

```bash
npm install --save-dev ava jsdom
```

And add a test script to our `package.json` and configure ava to compile files that we import into our tests.
Then add a test script to our `package.json` and configure AVA to compile files that we import into our tests.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AVA in capitalize and « And » to « Then » to avoid repetition with « and » after package.

@@ -33,11 +34,13 @@ And add a test script to our `package.json` and configure ava to compile files t
```

We are going to write our tests in the `test` folder:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line return like Markdown convention.

```bash
mkdir test
```

Let's say we have a page in `pages/index.vue`:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line return like Markdown convention.

@@ -58,7 +61,7 @@ export default {
</style>
```

When we launch our app with `npm run dev` and open [http://localhost:3000](http://localhost:3000), we can see our red `Hello world!` title.
When we launch our app with `npm run dev` and open http://localhost:3000, we can see our red `Hello world!` title.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid link for all localhost path because in most cases that conduces to 404 page.

@@ -67,7 +70,7 @@ import test from 'ava'
import { Nuxt, Builder } from 'nuxt'
import { resolve } from 'path'

// We keep a reference to nuxt so we can close
// We keep a reference to Nuxt so we can close
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Product name

@@ -90,7 +93,7 @@ test('Route / exits and render HTML', async t => {
t.true(html.includes('<h1 class="red">Hello world!</h1>'))
})

// Example of testing via dom checking
// Example of testing via DOM checking
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DOM is in capitalize.
— Source: https://www.w3.org/DOM/

@@ -100,13 +103,14 @@ test('Route / exits and render HTML with CSS applied', async t => {
t.is(window.getComputedStyle(element).color, 'red')
})

// Close the nuxt server
// Close the Nuxt server
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Product name.

test.after('Closing server', t => {
nuxt.close()
})
```

We can now launch our tests:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line return like Markdown convention.

@atinux atinux merged commit aa5f068 into nuxt:master Sep 28, 2017
@MachinisteWeb MachinisteWeb deleted the deployment-tools branch September 28, 2017 10:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants