-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
71e243e
commit f9484e6
Showing
10 changed files
with
7,952 additions
and
0 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,52 @@ | ||
# validate-npm-pc | ||
|
||
## 1.0.9 | ||
|
||
### Patch Changes | ||
|
||
- ec9d61a: Module fix | ||
|
||
## 1.0.8 | ||
|
||
### Patch Changes | ||
|
||
- 4371fc0: test/publish-process-another-update | ||
|
||
## 1.0.7 | ||
|
||
### Patch Changes | ||
|
||
- 773c804: publish lastest | ||
|
||
## 1.0.6 | ||
|
||
### Patch Changes | ||
|
||
- 8aed3fe: publish new | ||
|
||
## 1.0.5 | ||
|
||
### Patch Changes | ||
|
||
- 46c9206: add type to jest | ||
- e4c2114: add package type | ||
- f3fef1a: rearrange logic | ||
|
||
## 1.0.4 | ||
|
||
### Patch Changes | ||
|
||
- ee3a7db: test publish process | ||
|
||
## 1.0.3 | ||
|
||
### Patch Changes | ||
|
||
- 4bde7a0: add new social link | ||
- f69d51c: update social links | ||
|
||
## 1.0.2 | ||
|
||
### Patch Changes | ||
|
||
- ad1aa77: Adding new social link |
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 @@ | ||
# validate-npm-pc |
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,43 @@ | ||
import { validMobileNo, validEmail, validSocial } from "../src/index"; | ||
|
||
describe("validMobileNo", () => { | ||
test("Valid mobile number with + sign and 15 digits", () => { | ||
expect(validMobileNo("+234706469321234")).toBe(true); | ||
}); | ||
|
||
test("Invalid mobile number without + sign", () => { | ||
expect(validMobileNo("234706469321234")).toBe(false); | ||
}); | ||
|
||
test("Invalid mobile number with more than 15 digits", () => { | ||
expect(validMobileNo("+23470646932123456")).toBe(false); | ||
}); | ||
}); | ||
|
||
describe("validEmail", () => { | ||
test("Valid email address", () => { | ||
expect(validEmail("[email protected]")).toBe(true); | ||
}); | ||
|
||
test('Invalid email address without "@" symbol', () => { | ||
expect(validEmail("examplemail.com")).toBe(false); | ||
}); | ||
|
||
test("Invalid email address without domain", () => { | ||
expect(validEmail("example@mail")).toBe(false); | ||
}); | ||
}); | ||
|
||
describe("validSocial", () => { | ||
test("Valid Facebook URL", () => { | ||
expect(validSocial("https://www.facebook.com/example")).toBe(true); | ||
}); | ||
|
||
test("Valid Twitter URL", () => { | ||
expect(validSocial("https://www.twitter.com/example")).toBe(true); | ||
}); | ||
|
||
test("Invalid URL", () => { | ||
expect(validSocial("https://www.invalid.com/example")).toBe(false); | ||
}); | ||
}); |
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,6 @@ | ||
const config = { | ||
moduleFileExtensions: ["ts", "tsx", "js"], | ||
preset: "ts-jest", | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.