Spec-check test suite + token generator

I’m working on a refactor of api-test-suite that I’m calling spec-check which should be more up-to-date until version 22.

It’s ported to JavaScript so Mocha can run it in the browser, and there’s built-in token generation to streamline configuration; kind of like a browser-based ‘validator’ tool.

main

Of course it’s still possible to set environment variables and test locally on your machine.

Tests no longer depend on other tests which should simplify debugging and isolation. If I’ve missed any, be welcome to add them.

The spec version to test comes from the webfinger response by default, but you can also use the browser version to say “test that this server conforms to version X”.

Also, Mocha has this grep option so you can filter tests in the browser, for example public folder with no token.

I hope this can make server development easier :slightly_smiling_face:

2 Likes

I’m hoping some of you can help me solve why the browser requests work on my local machine but not on the public deployment – getting lots of error 405 for some reason :face_with_crossed_out_eyes:

405 solved below

Fantastic!

The 405s are resulting from trying to PUT to GitHub Pages I think:

PUT https://spec-check.0data.app/storage.kosmos.org/jimmy/api-test-suite/202602110754322278bx5r33t5dk/20260211075432227jh2d3itpsv

I had to click the Webfinger button again before getting each token, which wasn’t obvious to me. Maybe that could be improved. If all tokens are required (which seems like it’s the case), then that could also be made more obvious perhaps.

I think we might want to retire the old test suite at some point and turn this into the “official” compliance tester under a remotestorage.io (or .org) subdomain.

1 Like

Huh! I see that now, but not sure why it happens, as the debugger seems to show the correct URL passed to fetch. I did notice earlier that the Sec-Fetch-Site header seems to be set to same-origin for some reason, maybe that’s a GitHub thing that will fix itself with other hosting.

Hadn’t thought to store the webfinger response but that would probably streamline the UX further. Need to focus on something else at the moment but made an issue if anyone else wants to PR store webfinger response · Issue #1 · 0dataapp/spec-check · GitHub

I’m open :+1:t4:. No issue for me to move it to the rs org also.

1 Like

this ‘host interception’ thing is happening also when i deploy to a non-github server

i have the fetch arguments logging here and you can see how the actual network request is different from the url parameter. what magic is this ?

ok fixed! i was lazy replacing // in case i didn’t concatenate paths properly and this was removing it from https:// as well :man_facepalming:t4:

mostly works as expected except for the OPTIONS tests, but at least it basically runs now

1 Like