Skip to content

Commit

Permalink
Adding keyFilename for all tests (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian authored and JustinBeckwith committed Jul 11, 2018
1 parent 1525e26 commit 4909878
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions test/timestamp.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function createInstance(opts, document) {
let firestore = new Firestore(Object.assign({}, opts, {
projectId: 'test-project',
sslCreds: grpc.credentials.createInsecure(),
keyFilename: './test/fake-certificate.json',
}));

return firestore._ensureClient().then(() => {
Expand Down Expand Up @@ -79,7 +80,6 @@ describe('timestamps', function() {
return createInstance(
{
timestampsInSnapshots: true,
keyFilename: './test/fake-certificate.json',
},
DOCUMENT_WITH_TIMESTAMP)
.then(firestore => {
Expand Down Expand Up @@ -110,11 +110,7 @@ describe('timestamps', function() {

it('retain seconds and nanoseconds', function() {
return createInstance(
{
timestampsInSnapshots: true,
keyFilename: './test/fake-certificate.json',
},
DOCUMENT_WITH_TIMESTAMP)
{timestampsInSnapshots: true}, DOCUMENT_WITH_TIMESTAMP)
.then(firestore => {
return firestore.doc('coll/doc').get().then(res => {
const timestamp = res.get('moonLanding');
Expand All @@ -126,11 +122,7 @@ describe('timestamps', function() {

it('convert to date', function() {
return createInstance(
{
timestampsInSnapshots: true,
keyFilename: './test/fake-certificate.json',
},
DOCUMENT_WITH_TIMESTAMP)
{timestampsInSnapshots: true}, DOCUMENT_WITH_TIMESTAMP)
.then(firestore => {
return firestore.doc('coll/doc').get().then(res => {
const timestamp = res.get('moonLanding');
Expand All @@ -143,11 +135,7 @@ describe('timestamps', function() {

it('convert to millis', function() {
return createInstance(
{
timestampsInSnapshots: true,
keyFilename: './test/fake-certificate.json',
},
DOCUMENT_WITH_TIMESTAMP)
{timestampsInSnapshots: true}, DOCUMENT_WITH_TIMESTAMP)
.then(firestore => {
return firestore.doc('coll/doc').get().then(res => {
const timestamp = res.get('moonLanding');
Expand All @@ -158,11 +146,7 @@ describe('timestamps', function() {

it('support missing values', function() {
return createInstance(
{
timestampsInSnapshots: true,
keyFilename: './test/fake-certificate.json',
},
DOCUMENT_WITH_EMPTY_TIMESTAMP)
{timestampsInSnapshots: true}, DOCUMENT_WITH_EMPTY_TIMESTAMP)
.then(firestore => {
const expected = new Firestore.Timestamp(0, 0);

Expand Down

0 comments on commit 4909878

Please sign in to comment.