Skip to content

Commit 50871ac

Browse files
authored
Merge pull request #5 from gratiaa/fix-typos
[PR] Fix typos in exercise/queries
2 parents 78228db + ac7bdd7 commit 50871ac

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

exercises/queries/__test__/queries.spec.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
const Post = require('../post')
1010
const Author = require('../author')
1111
const mongoose = require('mongoose')
12-
const createConent = (length, fill = 'b') => new Array(length).fill(fill).join('')
12+
const createContent = (length, fill = 'b') => new Array(length).fill(fill).join('')
1313

1414
describe('queries', () => {
1515
describe('postByTitle', () => {
@@ -18,7 +18,7 @@ describe('queries', () => {
1818
const post = await Post.create({
1919
title,
2020
author: mongoose.Types.ObjectId(),
21-
content: createConent(50),
21+
content: createContent(50),
2222
contentLength: 50
2323
})
2424

@@ -33,7 +33,7 @@ describe('queries', () => {
3333
const post = await Post.create({
3434
author,
3535
title: 'Carter v',
36-
content: createConent(50),
36+
content: createContent(50),
3737
contentLength: 50
3838
})
3939
const [match] = await postsForAuthor(author)
@@ -46,9 +46,9 @@ describe('queries', () => {
4646
const author = mongoose.Types.ObjectId()
4747

4848
const posts = await Post.create([
49-
{title: 'Super Duper', author, content: createConent(1000), contentLength: 1000},
50-
{title: 'Amazing', author, content: createConent(100), contentLength: 100},
51-
{title: 'Other', author, content: createConent(800), contentLength: 800}
49+
{title: 'Super Duper', author, content: createContent(1000), contentLength: 1000},
50+
{title: 'Amazing', author, content: createContent(100), contentLength: 100},
51+
{title: 'Other', author, content: createContent(800), contentLength: 800}
5252
])
5353

5454
const matches = await postByContentLength(1000, 100)
@@ -64,15 +64,15 @@ describe('queries', () => {
6464
const post = await Post.create({
6565
title: 'Super Duper',
6666
author: author.id,
67-
content: createConent(1000),
67+
content: createContent(1000),
6868
contentLength: 1000
6969
})
7070
const post2 = await Post.create({
7171
author: author.id,
7272
title: 'Post 2',
73-
content: createConent(100),
73+
content: createContent(100),
7474
contentLength: 100,
75-
simularPosts: [post.id]
75+
similarPosts: [post.id]
7676
})
7777

7878
const match = await fullPostById(post2.id)
@@ -83,9 +83,9 @@ describe('queries', () => {
8383
test('only selects fields given', async () => {
8484
const author = mongoose.Types.ObjectId()
8585
await Post.create([
86-
{title: 'learn things', content: createConent(100), contentLength: 100, author},
87-
{title: 'lean more things', content: createConent(100), contentLength: 100, author},
88-
{title: 'lean more things++', content: createConent(100), contentLength: 100, author}
86+
{title: 'learn things', content: createContent(100), contentLength: 100, author},
87+
{title: 'lean more things', content: createContent(100), contentLength: 100, author},
88+
{title: 'lean more things++', content: createContent(100), contentLength: 100, author}
8989
])
9090

9191
const matches = await allPostsSlim({title: 1, content: 1})
@@ -98,12 +98,12 @@ describe('queries', () => {
9898
})
9999
})
100100
describe('addRelatedPosts', () => {
101-
test('should not overrided related posts that are there', async () => {
101+
test('should not override related posts that are there', async () => {
102102
const author = mongoose.Types.ObjectId()
103103
const post = await Post.create({
104104
author,
105105
title: 'Post',
106-
content: createConent(100),
106+
content: createContent(100),
107107
contentLength: 100,
108108
similarPosts: [mongoose.Types.ObjectId()]
109109
})

exercises/queries/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const postSchema = new mongoose.Schema({
2323
},
2424
isFeatured: {
2525
type: Boolean,
26-
deafult: false
26+
default: false
2727
},
2828
similarPosts: [{
2929
type: mongoose.Schema.Types.ObjectId,

0 commit comments

Comments
 (0)