Skip to content
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

[chore] move umap utils to a module #1718

Merged
merged 4 commits into from
Apr 1, 2024
Merged

[chore] move umap utils to a module #1718

merged 4 commits into from
Apr 1, 2024

Conversation

almet
Copy link
Member

@almet almet commented Mar 28, 2024

Allow the tests to be run from inside a cli, without requiring a browser.

I left the domUtils in umap.core because of their dependency to Leaflet specific domutils and L.Events.

Here are the tests I removed.

describe('#TextColorFromBackgroundColor', function () {
    it('should output white for black', function () {
      document.body.style.backgroundColor = 'black'
      assert.equal(L.DomUtil.TextColorFromBackgroundColor(document.body), '#ffffff')
    })

    it('should output white for brown', function () {
      document.body.style.backgroundColor = 'brown'
      assert.equal(L.DomUtil.TextColorFromBackgroundColor(document.body), '#ffffff')
    })

    it('should output black for white', function () {
      document.body.style.backgroundColor = 'white'
      assert.equal(L.DomUtil.TextColorFromBackgroundColor(document.body), '#000000')
    })

    it('should output black for tan', function () {
      document.body.style.backgroundColor = 'tan'
      assert.equal(L.DomUtil.TextColorFromBackgroundColor(document.body), '#000000')
    })

    it('should output black by default', function () {
      document.body.style.backgroundColor = 'transparent'
      assert.equal(L.DomUtil.TextColorFromBackgroundColor(document.body), '#000000')
    })
  })

Allow the tests to be run from inside a cli, without requiring a browser.
It will run both the Python and JS tests. Test suites can still be run
independently with the `make testjs` and `make testpy` commands.
It now includes the new commands.
Copy link
Member

@yohanboniface yohanboniface left a comment

Choose a reason for hiding this comment

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

Excellent!

@almet almet merged commit 05a25ed into master Apr 1, 2024
4 checks passed
@almet almet deleted the js-unittests-cli branch April 1, 2024 09:12
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.

None yet

2 participants