Self-service
Describe the bug
When running the constraints plugin, if the expected field value is an object, it prints [object Object] rather than the JSON stringified (or human readable) form.
To reproduce
const fs = require('fs');
await packageJsonAndInstall({
bin: {
key: 'this is visible',
},
_bin: {
key: './bin/entry.js',
}
});
const constraints = `gen_enforced_field(WorkspaceCwd, 'bin', Value) :- workspace_field(WorkspaceCwd, '_bin', Value).`;
await fs.promises.writeFile('constraints.pro', constraints, 'utf-8');
await expect(yarn(`constraints`)).rejects.toThrow(expect.stringContaining('[object Object]'));
and you'll see:

Environment
System:
OS: macOS 11.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 14.17.3 - /private/var/folders/ft/b9p2qq2n2h31j10zcc8d48qh0000gp/T/xfs-ad65a9aa/node
Yarn: 3.0.0 - /private/var/folders/ft/b9p2qq2n2h31j10zcc8d48qh0000gp/T/xfs-ad65a9aa/yarn
Additional context
The existing value is printed correctly. It's only the expected value having issues.
Self-service
Describe the bug
When running the constraints plugin, if the expected field value is an object, it prints
[object Object]rather than the JSON stringified (or human readable) form.To reproduce
and you'll see:
Environment
System:
OS: macOS 11.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Binaries:
Node: 14.17.3 - /private/var/folders/ft/b9p2qq2n2h31j10zcc8d48qh0000gp/T/xfs-ad65a9aa/node
Yarn: 3.0.0 - /private/var/folders/ft/b9p2qq2n2h31j10zcc8d48qh0000gp/T/xfs-ad65a9aa/yarn
Additional context
The existing value is printed correctly. It's only the expected value having issues.