supabase-js
supabase-js copied to clipboard
chore: restructure `test` folder
Describe the chore
It would be good to have all the expected results (basically the constants created in each test file) defined in a separate file maybe something like: test/utils/constants.ts
for better readability and maintainability. Actually we can do further more restructuring with the test folder; like right now we have a helper.test.ts
and a helpers.test.ts
file where both are testing the functions defined in lib/helpers.ts so why not do something like this:
.
├── test
│ ├── utils
│ ├── constants.ts
│ ├──supabase
│ └── helpers.test.ts
│ └── client.test.ts
│ └── ....
└── ...
Also the constants.test.ts
file is just checking the type of the DEFAULT_HEADERS object which seems unnecessary so instead we can add a static type check like this:
export const DEFAULT_HEADERS: {[key: string]: string} = {
'X-Client-Info': `supabase-js/${version}`,
};
Feel free to suggest anything you feel can be done to further improve this :)