Skip to content

Commit

Permalink
chore: add test package before publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
onedionys committed Mar 8, 2024
1 parent ee55a8e commit d4ac2b5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/index.test.js
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
});

0 comments on commit d4ac2b5

Please sign in to comment.