Created
May 31, 2020 04:00
-
-
Save night-fury-rider/80f379619a9a79932eadc73bebed91a7 to your computer and use it in GitHub Desktop.
Unit testing Angular Application using Jasmine - Util Service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class UvUtilService { | |
constructor() { } | |
/** | |
* @description Function to know passed array are equal or not | |
* @param arr1 - Array 1 | |
* @param arr2 - Array 2 | |
* @returns true if arrays are equal otherwise return false. | |
* Note: This method is not recommended if array is large | |
*/ | |
areArraysEqual(arr1, arr2) { | |
return JSON.stringify(arr1) === JSON.stringify(arr2); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment