I think you need [] brackets on your example:
'my' => ['expected_json_structure']
Here is my working example.
public function testToSeeIfItChecksForPasswordField()
{
$this->json('POST', '/auth/login', ['email' => '[email protected]'])
->seeJson([
"password" => ["The password field is required."],
]);
}
You might also use seeJsonStructure as below
public function testLoginWithValidUser()
{
factory(User::class)->create(['first_name' => 'testFirstNameString', 'email' => 'user1@example.com', 'password' => app('hash')->make('123456')]);
$this->json('POST', '/auth/login', ['email' => 'user1@example.com', 'password' => '123456'])
->seeJsonStructure(['token']);
}