Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should raises an error when call with invalid args', () => {
// $ExpectError: first argument is required
BarCodeScanner.scanFromURLAsync();
// $ExpectError: first argument must be a string
BarCodeScanner.scanFromURLAsync(123);
// $ExpectError: second argument must be an array
BarCodeScanner.scanFromURLAsync('url', 123);
BarCodeScanner.scanFromURLAsync('url', [
// $ExpectError: invalid barcode type
123,
]);
});
});
it('should raises an error when call with invalid args', () => {
// $ExpectError: first argument is required
BarCodeScanner.scanFromURLAsync();
// $ExpectError: first argument must be a string
BarCodeScanner.scanFromURLAsync(123);
// $ExpectError: second argument must be an array
BarCodeScanner.scanFromURLAsync('url', 123);
BarCodeScanner.scanFromURLAsync('url', [
// $ExpectError: invalid barcode type
123,
]);
});
});
it('should raises an error when call with invalid args', () => {
// $ExpectError: first argument is required
BarCodeScanner.scanFromURLAsync();
// $ExpectError: first argument must be a string
BarCodeScanner.scanFromURLAsync(123);
// $ExpectError: second argument must be an array
BarCodeScanner.scanFromURLAsync('url', 123);
BarCodeScanner.scanFromURLAsync('url', [
// $ExpectError: invalid barcode type
123,
]);
});
});
it('should pass when call with valid array of BarCodeType', () => {
BarCodeScanner.scanFromURLAsync('url', [
Constants.BarCodeType.qr,
Constants.BarCodeType.aztec,
]);
});