From 33d80df3167fd8b5b570f731fafcc718d04409af Mon Sep 17 00:00:00 2001 From: Alan Gutierrez Date: Sat, 13 Nov 2021 22:02:30 -0600 Subject: [PATCH] Tidy test of automatic keys. See #29. --- test/automatic.t.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/automatic.t.js b/test/automatic.t.js index 54579b5..026f46c 100644 --- a/test/automatic.t.js +++ b/test/automatic.t.js @@ -1,5 +1,5 @@ // Count of tests for a single pass of tests for either `etcd` or Addendum. -const count = 6 +const count = 5 // Count of tests for a single pass of tests for either `etcd` or Addendum. const harness = require('./harness') @@ -50,13 +50,14 @@ async function test (okay, { POST, DELETE, GET, PUT, prune }) { // expected key. const pruned = prune(response) key = pruned.data.node.key - delete pruned.data.node.key - okay(/^\/addendum\/queue\/0\d{19}$/.test(key), 'generated key') okay(pruned, { status: 201, data: { action: 'create', - node: { value: 'x' } + node: { + value: 'x', + key: `/addendum/queue/${response.headers['x-etcd-index'].padStart(20, '0')}` + } } }, 'get empty root directory') }