Level / abstract-leveldown

An abstract prototype matching the leveldown API.
MIT License
146 stars 53 forks source link

Open Test - Regular expression is too strict. #306

Closed radzom closed 6 years ago

radzom commented 6 years ago

When running the test against a leveldown the returned error is

Error: Invalid argument: /private/var/folders/y8/qkr7ksrx4_jc6sv_gxhzbc740000gn/T/8e00a031a916aacd4abb6ab3e3d6068f: does not exist (create_if_missing is false)

That does not matches the required "exists" (missing the s at the end)

https://github.com/Level/abstract-leveldown/blob/8ca1de858a6c98d9de4eb1063aba670d57df7afa/abstract/open-test.js#L101

Suggested solution just check for /exist/

t.ok(/exist/.test(err.message), 'error is about already existing') 
vweevers commented 6 years ago

When running the test against a leveldown

I'm not sure what you mean. Can you please share code and commands to reproduce?

radzom commented 6 years ago

Issue can be closed sorry for the trouble.

My misconception was the factory function not supporting a location argument in my example

If you are still interested here is the simplified example to reproduce the so thought problem.

const test = require('tape')
const testCommon = require('abstract-leveldown/testCommon')
const leveldown = require('leveldown')
const tempy = require('tempy')
const factory = () => leveldown(tempy.directory())

test('integration with leveldown', t => {
  require('abstract-leveldown/abstract/open-test').all(factory, t.test, testCommon)
})