1 | // test array fields
|
2 |
|
3 | var assert = require('assert');
|
4 | var after = require('after');
|
5 |
|
6 | var Model = require('../model');
|
7 |
|
8 | suite('arrays');
|
9 |
|
10 | // placeholder for the Post model
|
11 | var Post = Model({
|
12 | title: String,
|
13 | comments: [{
|
14 | text: String,
|
15 | author: String
|
16 | }]
|
17 | });
|
18 |
|
19 | test('field should be an array', function() {
|
20 | var post = Post();
|
21 |
|
22 | assert(post.comments instanceof Array);
|
23 | });
|
24 |
|