you can either use truffle-assertions with
npm install truffle-assertions
in your test code
const truffleAssert = require('truffle-assertions');
await truffleAssert.reverts(InstancecontractInstance.testwithdraw(1));
or you can use a simple try catch with
try {
await InstancecontractInstance.testwithdraw(1);
} catch(err) {
Error = err
}
assert.equal(Error.reason, 'not valid!');