mirror of
https://github.com/pebble-dev/clay.git
synced 2026-08-28 04:46:57 -04:00
31 lines
645 B
JavaScript
31 lines
645 B
JavaScript
'use strict';
|
|
|
|
var utils = require('../../../src/scripts/lib/utils');
|
|
var assert = require('chai').assert;
|
|
|
|
describe('Utils', function() {
|
|
describe('.updateProperties', function() {
|
|
var obj;
|
|
|
|
beforeEach(function() {
|
|
obj = {
|
|
one: 1,
|
|
two: 2
|
|
};
|
|
});
|
|
|
|
it('sets the properties as non-writable', function() {
|
|
utils.updateProperties(obj, { writable: false });
|
|
assert.strictEqual(
|
|
Object.getOwnPropertyDescriptor(obj, 'one').writable,
|
|
false
|
|
);
|
|
assert.strictEqual(
|
|
Object.getOwnPropertyDescriptor(obj, 'two').writable,
|
|
false
|
|
);
|
|
});
|
|
});
|
|
});
|
|
|