-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from wopehq/update-tests-and-action-for-bun
chore: update tests and action for bun
- Loading branch information
Showing
14 changed files
with
145 additions
and
961 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
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 |
---|---|---|
@@ -1,40 +1,40 @@ | ||
import { describe, it, expect } from 'vitest'; | ||
import { describe, it, expect } from 'bun:test'; | ||
import execRegex from '../src/parser/regex/execRegex'; | ||
|
||
describe('execRegex Tests', () => { | ||
it('Case 1: Pre-defined Regex - url', () => { | ||
const value = 'test https://google.com/ '; | ||
const result = execRegex(value, 'url'); | ||
expect('https://google.com/').to.deep.equal(result); | ||
expect('https://google.com/').toEqual(result); | ||
}); | ||
|
||
it('Case 1.1: Pre-defined Regex - url', () => { | ||
const value = 'test https://google.com/images test '; | ||
const result = execRegex(value, 'url'); | ||
expect('https://google.com/images').to.deep.equal(result); | ||
expect('https://google.com/images').toEqual(result); | ||
}); | ||
|
||
it('Case 1.2: Pre-defined Regex - url', () => { | ||
const value = 'test https://google.com/images?q=sunset test '; | ||
const result = execRegex(value, 'url'); | ||
expect('https://google.com/images?q=sunset').to.deep.equal(result); | ||
expect('https://google.com/images?q=sunset').toEqual(result); | ||
}); | ||
|
||
it('Case 2: Pre-defined Regex - email', () => { | ||
const value = 'test test@email.com '; | ||
const result = execRegex(value, 'email'); | ||
expect('test@email.com').to.deep.equal(result); | ||
expect('test@email.com').toEqual(result); | ||
}); | ||
|
||
it('Case 3: As Object', () => { | ||
const value = 'test 26'; | ||
const result = execRegex(value, { pattern: '\\d+' }); | ||
expect('26').to.deep.equal(result); | ||
expect('26').toEqual(result); | ||
}); | ||
|
||
it('Case 4: As Regex Object ', () => { | ||
const value = 'test 26'; | ||
const result = execRegex(value, /\d+/); | ||
expect('26').to.deep.equal(result); | ||
expect('26').toEqual(result); | ||
}); | ||
}); |
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 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 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
Oops, something went wrong.