Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

acquit for all guides #3392

Open
vkarpov15 opened this issue Sep 21, 2015 · 2 comments
Open

acquit for all guides #3392

vkarpov15 opened this issue Sep 21, 2015 · 2 comments
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Milestone

Comments

@vkarpov15
Copy link
Collaborator

No description provided.

@vkarpov15 vkarpov15 added this to the 4.2 milestone Sep 21, 2015
@vkarpov15 vkarpov15 modified the milestones: 4.3, 4.2 Oct 8, 2015
@vkarpov15 vkarpov15 modified the milestones: 4.5, 4.4 Feb 1, 2016
@vkarpov15 vkarpov15 modified the milestones: 4.6, 4.5 May 14, 2016
@vkarpov15 vkarpov15 modified the milestones: 5.0, 4.8 Dec 22, 2016
@hasezoey
Copy link
Collaborator

what exactly is this issue trying to track and what still needs to be done?

(also i think the docs label should be added)

@Uzlopak Uzlopak added the docs This issue is due to a mistake or omission in the mongoosejs.com documentation label Aug 12, 2022
@hasezoey
Copy link
Collaborator

what exactly is this issue trying to track and what still needs to be done?

thanks to some more time and #13635, i think i now know the purpose of this issue better, following is a description of what this issue is about and what still needs to be done


this issue is tracking that most code examples in the documentation are actually tests and extracted and inserted into the documentation from those tests

example in documentation:

```acquit
[require:Built-in Promises]
```

test example:

it('Built-in Promises', function(done) {
const gnr = new Band({
name: 'Guns N\' Roses',
members: ['Axl', 'Slash']
});
const promise = gnr.save();
assert.ok(promise instanceof Promise);
promise.then(function(doc) {
assert.equal(doc.name, 'Guns N\' Roses');
// acquit:ignore:start
done();
// acquit:ignore:end
});
});

examples of which still need to be transferred:

mongoose/docs/faq.md

Lines 35 to 51 in e48aa77

```javascript
await mongoose.createConnection(mongodbUri).asPromise();
const Test = mongoose.model('Test', schema);
await Test.findOne(); // Will throw "Operation timed out" error because didn't call `mongoose.connect()`
```
```javascript
await mongoose.connect(mongodbUri);
const db = mongoose.createConnection();
const Test = db.model('Test', schema);
await Test.findOne(); // Will throw "Operation timed out" error because `db` isn't connected to MongoDB
```


some questions regarding some examples:

  • what should we do about examples that use const mongoose = require('mongoose'), should we let this be staying in a test, or should we remove those imports OR should we leave that import statement in the codeblock and only insert the acquit insert? (they should be combined to my understanding) example
  • the same as the first, what should we do about import ... from "mongoose"?
  • should "small" example also be transferred to tests, like one-liners? example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This issue is due to a mistake or omission in the mongoosejs.com documentation
Projects
None yet
Development

No branches or pull requests

3 participants