diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08332857..37bbc675 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,9 +10,9 @@ jobs: matrix: node-version: [18.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -23,11 +23,11 @@ jobs: timeout-minutes: 10 strategy: matrix: - node-version: [14.x, 16.x, 18.x, 20.x] + node-version: [14.x, 16.x, 18.x, 20.x, 22.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install @@ -44,9 +44,9 @@ jobs: node-version: [16.x] bundler: [webpack, browserify] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install @@ -64,9 +64,9 @@ jobs: matrix: node-version: [16.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - run: npm install @@ -80,9 +80,9 @@ jobs: matrix: node-version: [18.x] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} - name: Install @@ -92,7 +92,8 @@ jobs: - name: Generate coverage report run: npm run coverage-ci - name: Upload coverage to Codecov - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v4 with: file: ./coverage/lcov.info fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c0926a8..87a652b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # jsonld ChangeLog +## 8.3.3 - xxxx-xx-xx + +### Added +- Added URL to context resolution error message. + ## 8.3.2 - 2023-12-06 ### Fixed diff --git a/lib/ContextResolver.js b/lib/ContextResolver.js index e70ba98a..29579ac6 100644 --- a/lib/ContextResolver.js +++ b/lib/ContextResolver.js @@ -176,7 +176,8 @@ module.exports = class ContextResolver { 'a same-origin policy (ensure the server uses CORS if you are ' + 'using client-side JavaScript), too many redirects, a ' + 'non-JSON response, or more than one HTTP Link Header was ' + - 'provided for a remote context.', + 'provided for a remote context. ' + + `URL: "${url}".`, 'jsonld.InvalidUrl', {code: 'loading remote context failed', url, cause: e}); } @@ -185,7 +186,8 @@ module.exports = class ContextResolver { if(!_isObject(context)) { throw new JsonLdError( 'Dereferencing a URL did not result in a JSON object. The ' + - 'response was valid JSON, but it was not a JSON object.', + 'response was valid JSON, but it was not a JSON object. ' + + `URL: "${url}".`, 'jsonld.InvalidUrl', {code: 'invalid remote context', url}); } diff --git a/tests/test.js b/tests/test.js index a0af0eba..998647ed 100644 --- a/tests/test.js +++ b/tests/test.js @@ -174,6 +174,7 @@ const TEST_TYPES = { /expand-manifest#tc037$/, /expand-manifest#tc038$/, /expand-manifest#ter54$/, + /expand-manifest#ter56$/, // html /html-manifest#te001$/, @@ -228,6 +229,7 @@ const TEST_TYPES = { /html-manifest#tf002$/, /html-manifest#tf003$/, /html-manifest#tf004$/, + /html-manifest#tf005$/, ] }, fn: 'flatten', @@ -306,6 +308,7 @@ const TEST_TYPES = { /toRdf-manifest#tc037$/, /toRdf-manifest#tc038$/, /toRdf-manifest#ter54$/, + /toRdf-manifest#ter56$/, /toRdf-manifest#tli12$/, /toRdf-manifest#tli14$/,