Skip to content

Instantly share code, notes, and snippets.

@OlivierJM
Created February 20, 2019 14:03
Show Gist options
  • Save OlivierJM/4132cc5aaf4617c857a3366c3874c7a8 to your computer and use it in GitHub Desktop.
Save OlivierJM/4132cc5aaf4617c857a3366c3874c7a8 to your computer and use it in GitHub Desktop.
it("should add the country when number starts with 9", () => {
expect(formatNumber("943434")("260")).toEqual("260 943434");
});
it("should format even if the code existed", () => {
expect(formatNumber("+260943434")("260")).toEqual("260 943434");
});
it("should format even if number is spaced out", () => {
expect(formatNumber("+260 943434")("260")).toEqual("260 943434");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment