jest test try catch
expect(() => {
const model = new Sample(resolvedSample)
}).toThrow(TypeError);describe('Dummy test', () => {
class Sample {
constructor(data){
this.resolvedData = this.retrieveData(data)
}
retrieveData(data){
try{
const resolvedData = data.map(o => o.name);
}catch(error){
throw error
}
}
}
test('should fail', () => {
expect(() => {
new Sample({});
}).toThrowError(TypeError);
});
});
Also in CSS:
- css transition on hover
- css center element on screen
- hand property css
- button two lines on ipad
- css flex vertical align
- how to link your css file to html
- css grid-template
- add background image css
- onclick url
- Ul or ol with no indent
- css backgroud position
- css class selector
- installer scss projet wordpress
- link to css
- skeleton loader css
- margin css
- justify text csss
- css rotate animation
- css gradient text
- hwo to use flexbox to make a nav bar
- como fazer listrada css
- jquery css add important
- absolute path and relative path
- textarea placeholder