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 pass invalid arguments', () => {
// $ExpectError: first argument is required
getInfoAsync();
// $ExpectError: first argument must be a string
getInfoAsync(69);
// $ExpectError: second argument must be an object
getInfoAsync('', 69);
// $ExpectError: 'abc' is missing in options
getInfoAsync('', { abc: 'test' });
getInfoAsync('', {
// $ExpectError
md5: 'need number',
});
});
});
it('should raises an error when pass invalid arguments', () => {
// $ExpectError: first argument is required
getInfoAsync();
// $ExpectError: first argument must be a string
getInfoAsync(69);
// $ExpectError: second argument must be an object
getInfoAsync('', 69);
// $ExpectError: 'abc' is missing in options
getInfoAsync('', { abc: 'test' });
getInfoAsync('', {
// $ExpectError
md5: 'need number',
});
});
});
it('should passes when used properly', () => {
readAsStringAsync('fileUri').then(fileInfo => {
(fileInfo: string);
// $ExpectError: check any
(fileInfo: number);
});
readAsStringAsync('fileUri', { encoding: 'base64' });
readAsStringAsync('fileUri', { position: 1 });
readAsStringAsync('fileUri', { length: 1 });
readAsStringAsync('fileUri', {
encoding: 'utf8',
position: 1,
length: 1,
});
});
it('should raises an error when pass invalid arguments', () => {
// $ExpectError: first argument is required
makeDirectoryAsync();
// $ExpectError: first argument must be a string
makeDirectoryAsync(69);
// $ExpectError: second argument must be an object
makeDirectoryAsync('', 69);
// $ExpectError: 'abc' is missing in options
makeDirectoryAsync('', { abc: 'test' });
makeDirectoryAsync('', {
// $ExpectError
intermediates: 'need boolean',
});
});
});
it('should raises an error when pass invalid arguments', () => {
// $ExpectError: first argument is required
makeDirectoryAsync();
// $ExpectError: first argument must be a string
makeDirectoryAsync(69);
// $ExpectError: second argument must be an object
makeDirectoryAsync('', 69);
// $ExpectError: 'abc' is missing in options
makeDirectoryAsync('', { abc: 'test' });
makeDirectoryAsync('', {
// $ExpectError
intermediates: 'need boolean',
});
});
});
it('should passes when used properly', () => {
makeDirectoryAsync('fileUri').then(fileInfo => {
(fileInfo: void);
// $ExpectError: check any
(fileInfo: number);
});
makeDirectoryAsync('fileUri', { intermediates: true });
});
it('should raises an error when pass invalid arguments', () => {
// $ExpectError: first argument is required
makeDirectoryAsync();
// $ExpectError: first argument must be a string
makeDirectoryAsync(69);
// $ExpectError: second argument must be an object
makeDirectoryAsync('', 69);
// $ExpectError: 'abc' is missing in options
makeDirectoryAsync('', { abc: 'test' });
makeDirectoryAsync('', {
// $ExpectError
intermediates: 'need boolean',
});
});
});
it('should raises an error when pass invalid arguments', () => {
// $ExpectError: first argument is required
deleteAsync();
// $ExpectError: first argument must be a string
deleteAsync(69);
// $ExpectError: second argument must be an object
deleteAsync('', 69);
// $ExpectError: 'abc' is missing in options
deleteAsync('', { abc: 'test' });
deleteAsync('', {
// $ExpectError
idempotent: 'need boolean',
});
});
});
it('should raises an error when pass invalid arguments', () => {
// $ExpectError: first argument is required
deleteAsync();
// $ExpectError: first argument must be a string
deleteAsync(69);
// $ExpectError: second argument must be an object
deleteAsync('', 69);
// $ExpectError: 'abc' is missing in options
deleteAsync('', { abc: 'test' });
deleteAsync('', {
// $ExpectError
idempotent: 'need boolean',
});
});
});
it('should raises an error when pass invalid arguments', () => {
// $ExpectError: first argument is required
deleteAsync();
// $ExpectError: first argument must be a string
deleteAsync(69);
// $ExpectError: second argument must be an object
deleteAsync('', 69);
// $ExpectError: 'abc' is missing in options
deleteAsync('', { abc: 'test' });
deleteAsync('', {
// $ExpectError
idempotent: 'need boolean',
});
});
});