-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add test package before publishing
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const assert = require('assert'); | ||
const socialSharingUtils = require('../src/socialSharingUtils'); | ||
|
||
describe('Social Sharing Utilities', function() { | ||
describe('#shareOnFacebook()', function() { | ||
it('should return a URL to share on Facebook', function() { | ||
const url = 'https://example.com'; | ||
const expected = 'https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fexample.com'; | ||
assert.strictEqual(socialSharingUtils.shareOnFacebook(url), expected); | ||
}); | ||
}); | ||
|
||
describe('#shareOnTwitter()', function() { | ||
it('should return a URL to share on Twitter', function() { | ||
const url = 'https://example.com'; | ||
const text = 'Check out this link'; | ||
const expected = 'https://twitter.com/intent/tweet?url=https%3A%2F%2Fexample.com&text=Check%20out%20this%20link'; | ||
assert.strictEqual(socialSharingUtils.shareOnTwitter(url, text), expected); | ||
}); | ||
}); | ||
|
||
// Add more tests for other social sharing platforms if needed | ||
}); |