Skip to content

feat(pagination): move hal tools to this repo#313

Closed
bertyhell wants to merge 3 commits intomasterfrom
feat/tools/formatters/pagination-hal-tools
Closed

feat(pagination): move hal tools to this repo#313
bertyhell wants to merge 3 commits intomasterfrom
feat/tools/formatters/pagination-hal-tools

Conversation

@bertyhell
Copy link
Copy Markdown
Contributor

@bertyhell bertyhell commented Dec 4, 2024

https://github.com/studiohyperdrive/hal-tools#readme

  • move hal pagination tools to this repo
  • update nx to v19.2.2
> tsc
Process finished with exit code 0
> npm run lint

=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=4.3.5 <5.4.0

YOUR TYPESCRIPT VERSION: 5.4.5

Please only submit bug reports when using the officially supported version.

=============

Process finished with exit code 0

> jest --coverage

 PASS  src/hal-format.helper.spec.ts
  HAL Format Tools
    calculateTotalPages
      √ should calculate the total amount of pages based on the page-size & total amount of items (2 ms)
      √ should round the result to top
      √ should cap the number of pages to maxPages if provided (1 ms)
    calculatePagination
      √ should return page and count information following the IHALPagination interface
    calculateNextPage
      √ should return the currentPage + 1 if there are next pages
      √ should return the currentPage if there are no next pages
      √ should return 1 if there is only one page (1 ms)
    createHalLinks                                                                                                                             
      √ should create a set of links based on the IHALPagination interface                                                                     
    HALFormat                                                                                                                                  
      √ should create a response conform to the IHALFormat (1 ms)                                                                              
      √ should create a response conform to the IHALFormat without links                                                                       
                                                                                                                                               
----------------------|---------|----------|---------|---------|-------------------                                                            
File                  | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s                                                             
----------------------|---------|----------|---------|---------|-------------------
All files             |     100 |      100 |     100 |     100 |                  
 hal-format.helper.ts |     100 |      100 |     100 |     100 |                  
----------------------|---------|----------|---------|---------|-------------------
Test Suites: 1 passed, 1 total
Tests:       10 passed, 10 total
Snapshots:   0 total
Time:        2.973 s
Ran all test suites.

Copy link
Copy Markdown
Contributor

@IbenTesara IbenTesara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small comments but looks good to me!

Comment thread tools/formatters/pagination-hal-tools/package.json Outdated
Comment thread tools/formatters/pagination-hal-tools/package.json Outdated
Copy link
Copy Markdown
Contributor

@IbenTesara IbenTesara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use lib generation command instead

@bertyhell bertyhell requested a review from IbenTesara December 4, 2024 14:57
@IbenTesara
Copy link
Copy Markdown
Contributor

Closing this PR in favour of the PR that includes the Git History.

@IbenTesara IbenTesara closed this Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants