Skip to content

Commit

Permalink
fix: use Swal.getIconContent() (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Nov 7, 2022
1 parent cc776ae commit 0b8115d
Show file tree
Hide file tree
Showing 6 changed files with 150 additions and 175 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:

- run: yarn test

- name: test in commonJS
run: node test/require-in-commonjs.cjs

- name: Run automated release process with semantic-release
if: github.ref_name == 'main'
uses: cycjimmy/semantic-release-action@v2
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"react-dom": "^18.2.0",
"rollup": "^3.0.0",
"rollup-plugin-terser": "^7.0.0",
"sweetalert2": "^11.5.2",
"sweetalert2": "^11.6.0",
"typescript": "^4.8.3",
"vite": "^3.1.8"
},
Expand Down
2 changes: 1 addition & 1 deletion src/mounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const mounts = [
},
{
key: 'iconHtml',
getter: (swal) => swal.getIcon().querySelector('.swal2-icon-content'),
getter: (swal) => swal.getIconContent(),
},
{
key: 'loaderHtml',
Expand Down
1 change: 1 addition & 0 deletions test/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = {
},
},
rules: {
'@typescript-eslint/no-var-requires': 0,
'no-console': 0,
},
}
4 changes: 4 additions & 0 deletions test/require-in-commonjs.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const assert = require('assert')
const withReactContent = require('../dist/sweetalert2-react-content.cjs.js')

assert.equal(withReactContent.name, 'withReactContent')
Loading

0 comments on commit 0b8115d

Please sign in to comment.