developit / stockroom

🗃 Offload your store management to a worker easily.
https://stockroom.surge.sh
1.76k stars 57 forks source link

TypeScript definitions #22

Open Silic0nS0ldier opened 5 years ago

Silic0nS0ldier commented 5 years ago

Addresses #21

I'm better at working with TypeScript on its own then I am at writing definitions, so let me know if I've screwed anything up.

Based on local integration testing, things seem to be working properly.

Silic0nS0ldier commented 5 years ago

Failing tests appear to be the ones that failed locally (before and after implementing changes). I'll investigate further once I've the chance.

Silic0nS0ldier commented 5 years ago

Test failures are probably down to 1 or more of the following

  1. Tests are incompatible with newer versions of Chrome.
  2. Dependencies have updated in a breaking way without using semver major. (karma failing to grab the version of Chrome and the OS seems to support this)
  3. Compiled source (babel, webpack, etc) are generating broken source (likely related to 2, if this is the case then updates cannot currently be published)

I'll continue investigate this more when I have the chance. Will probably end up rewriting the existing tests in the process (currently they look order sensitive, and from memory jest runs as much as it can in parallel). If there are any requests/preferences let me know.

Silic0nS0ldier commented 5 years ago

Still looking into the unit tests. Didn't mention before, but I have tested against older versions of node. Implementation wise its I thinking it will be best to test using plain web workers (no abstractions), and with abstractions. Should help to identify compilation errors in the future (and may provide a test case for #8 ).

I did notice karmatic however it doesn't provide a mechanism for customising the configuration, which would be needed to use it here.

developit commented 5 years ago

@Silic0nS0ldier It's likely impossible to test TS stuff via Karmatic, since tests are executed in a browser environment.