-
Notifications
You must be signed in to change notification settings - Fork 39
Decaffeination #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decaffeination #196
Conversation
As we did this previously, all in one commit rather than individually.
also apply to lib/forward.js
|
At this point, with all the tests converted, we can run |
`git mv lib/defaultargs.coffee lib/defaultargs.js`
|
Currently no tests for search, but the serialised index file before and after decaffienation are identical so that suggests the code does the same thing. |
|
while all the tests pass, there are a few things that don't work. |
- Remove used variables and parameters.
- The code to remove the update flag had dropped outside an `else` block, add the missing {}.
fix the pair-wise splitting of lineup url into pages and locations fix the reversed element / index in iterating of the entries in urlPages
Add update author script, with prior authors Add require for should to test, that use it Make async tests async, and await supertest requests Remove grunt file, and related packages
The server used in the tests will continue running until the sitemap time ends. Add an arg for testing to use a much shorter timeout.
|
Grunt has now been removed. Tests are run with |
remove {}’s so name is returned.
should hasn’t been archived, so replace with node’s builtin assert. add support for `node —test`, this is not ready as there appears to be a timeout issue causing describe to fail even though all the tests have passed.
In `lib/server.js`, don’t set a default `process.exitCode` when running tests. So the tests don't report a failure when the server is closed. In `lib/sitemap.js`, the sitemap timeout is not relevant for the test environment.
The changes in this commit focus on improving the asynchronous behavior of the page tests. The main changes are: - Refactor the tests to use `async/await` syntax for better readability and error handling. - Add `return new Promise` blocks to ensure the tests wait for callbacks to complete.
Express 5 Upgrade
* fetch: replace node-fetch with native fetch api replace CoffeeScript template literals to JavaScript
|
Express.js updated to v5, and node-fetch replaced with native Fetch. also fixed CoffeeScript template literals that were missed. |
Remove glob-based plugin page search in favor of a pre-populated Map of plugin page locations built during initialization
Removing use of glob()
Deprecated
lib/page.js, lib/server.js updated to use modern Promise-based async/await pattern instead of the callback-based async.map. Async dependency removed from package.json.
Removing dependency on Async package
|
Use of glob replaced with use of node's Modules: CommonJS, this will change at some point when we switch to ECMAScript modules. |
Converting the server to JavaScript.
Tests are converted first, and use of grunt to run mocha retained (for now), as it is configured to allow the use of a mix of CoffeeScript and JavaScript.
CoffeeScript files are renamed using git mv so we can follow the git blame path back to the original CoffeeScript.
Post convertion we should review each dependency, taking into account advances in JavaScript and Node.
This is a restart of PR195 due to some strangeness with preservation of git history over the conversion.