File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { assert } from "chai" ;
22import Postcode from "../lib/index" ;
3- import { loadFixtures , TestCase } from "./util/helper" ;
4-
5- type Method =
6- | "normalise"
7- | "incode"
8- | "outcode"
9- | "area"
10- | "district"
11- | "unit"
12- | "sector"
13- | "subDistrict" ;
14-
15- interface TestMethodOptions {
16- tests : TestCase [ ] ;
17- method : Method ;
18- }
19-
20- const testMethod = ( options : TestMethodOptions ) : void => {
3+ import { loadFixtures , TestMethod } from "./util/helper" ;
4+
5+ const testMethod : TestMethod = options => {
216 const { tests, method } = options ;
227 tests . forEach ( ( { base, expected } ) => {
238 const p = new Postcode ( base ) ;
Original file line number Diff line number Diff line change 11import { join } from "path" ;
22import { readFile } from "fs" ;
33
4+ type PostcodeMethod =
5+ | "normalise"
6+ | "incode"
7+ | "outcode"
8+ | "area"
9+ | "district"
10+ | "unit"
11+ | "sector"
12+ | "subDistrict" ;
13+
14+ interface TestMethodOptions {
15+ tests : TestCase [ ] ;
16+ method : PostcodeMethod ;
17+ }
18+
19+ export interface TestMethod {
20+ ( options : TestMethodOptions ) : void ;
21+ }
22+
423const dataDir = join ( __dirname , "../data" ) ;
524
625interface TestFixtures {
You can’t perform that action at this time.
0 commit comments