-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
995e953
commit d5e2316
Showing
4 changed files
with
16 additions
and
35 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2023-11-01T01:54:16.727Z |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,3 +37,4 @@ Stephannie Jiménez Gacha <[email protected]> | |
Yernar Yergaziyev <[email protected]> | ||
orimiles5 <[email protected]> | ||
rei2hu <[email protected]> | ||
Robert Gislason <[email protected]> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* @license Apache-2.0 | ||
* | ||
* Copyright (c) 2018 The Stdlib Authors. | ||
* Copyright (c) 2023 The Stdlib Authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
|
@@ -21,42 +21,13 @@ | |
// MODULES // | ||
|
||
var tape = require( 'tape' ); | ||
var isEmail = require( './../../dist' ); | ||
var main = require( './../../dist' ); | ||
|
||
|
||
// TESTS // | ||
|
||
tape( 'main export is a function', function test( t ) { | ||
tape( 'main export is defined', function test( t ) { | ||
t.ok( true, __filename ); | ||
t.strictEqual( typeof isEmail, 'function', 'main export is a function' ); | ||
t.end(); | ||
}); | ||
|
||
tape( 'the function returns `true` when provided an email address (equals a string including the `@` character)', function test( t ) { | ||
t.equal( isEmail( '[email protected]' ), true, 'returns true' ); | ||
t.end(); | ||
}); | ||
|
||
tape( 'the function returns `false` when not provided an email address', function test( t ) { | ||
var values; | ||
var i; | ||
|
||
values = [ | ||
'5', | ||
'beep', | ||
'beep/boop', | ||
'beep.com', | ||
5, | ||
null, | ||
void 0, | ||
NaN, | ||
true, | ||
[], | ||
{}, | ||
function noop() {} | ||
]; | ||
for ( i = 0; i < values.length; i++ ) { | ||
t.equal( isEmail( values[ i ] ), false, 'returns false' ); | ||
} | ||
t.strictEqual( main !== void 0, true, 'main export is defined' ); | ||
t.end(); | ||
}); |