generated from sindresorhus/node-module-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
461d09d
commit a890424
Showing
7 changed files
with
53 additions
and
36 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 |
---|---|---|
|
@@ -19,4 +19,4 @@ jobs: | |
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm install | ||
- run: npm test | ||
- run: npm run test |
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
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
This file was deleted.
Oops, something went wrong.
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
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,19 @@ | ||
import {expect} from 'chai'; | ||
import {describe, it} from 'mocha'; | ||
import CipherService from '../dist/src/cipher-service.js'; | ||
|
||
describe('CipherService', () => { | ||
it('can encrypt and decrypt the same content', () => { | ||
// Arrange | ||
const key = 'Password123'; | ||
const message = 'This is a test text message1'; | ||
const service = new CipherService(); | ||
|
||
// Act | ||
const cipherText = service.encrypt(key, message); | ||
const plainText = service.decrypt(key, cipherText); | ||
|
||
// Assert | ||
expect(plainText).to.equal(message); | ||
}); | ||
}); |
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