|
15 | 15 |
|
16 | 16 | var assert = require('assert');
|
17 | 17 |
|
18 |
| -var Query = require('../../datastore/concepts').Query; |
| 18 | +var concepts = require('../../datastore/concepts.js'); |
| 19 | +var testUtil = require('./util.js'); |
| 20 | + |
19 | 21 | var query;
|
| 22 | +var entity; |
20 | 23 |
|
21 | 24 | describe('datastore/concepts/query', function () {
|
22 | 25 | before(function() {
|
23 | 26 | var projectId = process.env.TEST_PROJECT_ID || 'nodejs-docs-samples';
|
24 |
| - query = new Query(projectId); |
| 27 | + entity = new concepts.Entity(projectId); |
| 28 | + query = new concepts.Query(projectId); |
| 29 | + }); |
| 30 | + |
| 31 | + after(function(done) { |
| 32 | + var datastore = query.datastore; |
| 33 | + var q = datastore.createQuery('Task'); |
| 34 | + |
| 35 | + testUtil.deleteEntities(datastore, q, done); |
25 | 36 | });
|
26 | 37 |
|
27 | 38 | describe('basic query', function() {
|
@@ -73,6 +84,10 @@ describe('datastore/concepts/query', function () {
|
73 | 84 | });
|
74 | 85 |
|
75 | 86 | describe('projection query', function() {
|
| 87 | + before(function(done) { |
| 88 | + entity.testProperties(done); |
| 89 | + }); |
| 90 | + |
76 | 91 | it('performs a projection query', function(done) {
|
77 | 92 | query.testRunQueryProjection(done);
|
78 | 93 | });
|
@@ -158,6 +173,10 @@ describe('datastore/concepts/query', function () {
|
158 | 173 | });
|
159 | 174 |
|
160 | 175 | describe('cursor paging', function() {
|
| 176 | + before(function(done) { |
| 177 | + entity.testBatchUpsert(done); |
| 178 | + }); |
| 179 | + |
161 | 180 | it('allows manual pagination through results', function(done) {
|
162 | 181 | query.testCursorPaging(done);
|
163 | 182 | });
|
|
0 commit comments