mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 20:36:26 +02:00
* license: update headers to IBM Corp. * `make proto` * update offset because source file changed Signed-off-by: Ryan Cragun <me@ryan.ec> Co-authored-by: Ryan Cragun <me@ryan.ec>
20 lines
608 B
JavaScript
20 lines
608 B
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import timestamp from 'core/utils/timestamp';
|
|
import sinon from 'sinon';
|
|
import { module, test } from 'qunit';
|
|
|
|
/*
|
|
This test coverage is more for an example than actually covering the utility
|
|
*/
|
|
module('Unit | Utility | timestamp', function () {
|
|
test('it can be overridden', function (assert) {
|
|
sinon.replace(timestamp, 'now', sinon.fake.returns(new Date('2030-03-03T03:30:03')));
|
|
const result = timestamp.now();
|
|
assert.strictEqual(result.toISOString(), new Date('2030-03-03T03:30:03').toISOString());
|
|
});
|
|
});
|