This methods returns an array of car colors with the given searchKey.
For example 1
returns
[
"white", "yellow", "blue"
]
If no car with the given searchKey is found return an empty array. If a parameter searchKey is missing, returns an empty array.
Test uses the default data.
Create register with default data.
const register = new carRegister(defaultData);
register.getCarColors(1);
expect
[
"white", "yellow", "blue"
]
to be returned
Test uses the default data.
Create register with default data.
const register = new carRegister(defaultData);
register.getCarColors(5);
expect
[
"red", "black", "orange"
]
to be returned
Test uses the default data.
Create register with default data.
const register = new carRegister(defaultData);
register.getCarColors(6);
expect
[]
to be returned
Test uses the default data.
Create register with default data.
const register = new carRegister(defaultData);
register.getCarColors('');
expect
[]
to be returned