tokenizer.count.test.js 677 B

12345678910111213141516171819202122
  1. var Tokenizer = require('../../../index').query.tokenizer;
  2. var assert = require('assert');
  3. describe('Tokenizer ::', function() {
  4. describe('COUNT statements', function() {
  5. it('should generate a valid token array when COUNT is used', function() {
  6. var result = Tokenizer({
  7. count: true,
  8. from: 'users'
  9. });
  10. assert.deepEqual(result, [
  11. { type: 'IDENTIFIER', value: 'COUNT' },
  12. { type: 'VALUE', value: true },
  13. { type: 'ENDIDENTIFIER', value: 'COUNT' },
  14. { type: 'IDENTIFIER', value: 'FROM' },
  15. { type: 'VALUE', value: 'users' },
  16. { type: 'ENDIDENTIFIER', value: 'FROM' }
  17. ]);
  18. });
  19. });
  20. });