Created
April 18, 2016 16:46
-
-
Save kyeotic/f3b5155fc0d0e18751a708a21fc67481 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--reporter spec | |
--require test/support/node | |
--recursive | |
--timeout 3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chai = require('chai') | |
var expect = chai.expect | |
var chaiAsPromised = require('chai-as-promised') | |
var sinon = require('sinon') | |
require('babel-polyfill') | |
chai.use(chaiAsPromised) | |
global.chaiAsPromised = chaiAsPromised | |
global.expect = chai.expect | |
global.sinon = sinon | |
global.Promise = Promise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dynamo = require('../../util/dynamo') | |
describe('dynamo module', function() { | |
describe('build update expression', function() { | |
it('should produce set expressions for changes', function() { | |
var original = { name: 'tim', age: 28 } | |
var updated = { name: 'tim', age: 29 } | |
var expression = dynamo.buildUpdateExpression(original, updated) | |
expect(Object.values(expression.names)).to.include('age') | |
expect(Object.values(expression.values)).to.include(29) | |
expect(expression.expression).to.match(/^SET/) | |
}) | |
it('should produce delete expressions for changes', function() { | |
var original = { name: 'tim', age: 28 } | |
var updated = { name: 'tim' } | |
var expression = dynamo.buildUpdateExpression(original, updated) | |
expect(Object.values(expression.names)).to.include('age') | |
expect(expression.expression).to.match(/^REMOVE/) | |
}) | |
}) | |
}) |
Author
kyeotic
commented
Apr 18, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment