-
Notifications
You must be signed in to change notification settings - Fork 4
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
74f1dd8
commit ec2c9f9
Showing
31 changed files
with
12,500 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 |
---|---|---|
|
@@ -57,3 +57,4 @@ typings/ | |
# dotenv environment variables file | ||
.env | ||
|
||
/bin |
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,2 +1,21 @@ | ||
# search-ui-tests | ||
|
||
Testing framework for the Coveo JavaScript Search Framework | ||
|
||
## Usage | ||
|
||
Include the compiled `bin/js/CoveoJsSearchTests.js` file in your test configuration. | ||
|
||
## Modules | ||
|
||
### Mock | ||
|
||
Allows to create mocks of components required for the framework. | ||
|
||
### Fake | ||
|
||
Allows to create fake objects like results, events and fields. | ||
|
||
### Simulate | ||
|
||
Allows to simulate some actions in the framework or in the browser. |
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,43 @@ | ||
const exec = require("child-process-promise").exec; | ||
const DtsBundle = require("dts-bundle"); | ||
const fs = require("fs"); | ||
|
||
const tempFolder = "./bin/temp"; | ||
const destFolder = "./bin/ts"; | ||
const dtsFileName = "coveo-search-ui-tests"; | ||
|
||
function Bundle() { | ||
return DtsBundle.bundle({ | ||
name: dtsFileName, | ||
// Relative to the "main" file, ¯\_(ツ)_/¯ | ||
main: `${tempFolder}/Index.d.ts` | ||
}); | ||
} | ||
|
||
function BuildDeclarationFiles() { | ||
return exec( | ||
`tsc --declaration --outDir ${tempFolder} --declarationDir ${tempFolder}` | ||
); | ||
} | ||
|
||
function CopyDtsInFolder() { | ||
return new Promise((resolve, reject) => { | ||
if (!fs.existsSync(destFolder)) { | ||
fs.mkdirSync(destFolder); | ||
} | ||
const stream = fs | ||
.createReadStream(`${tempFolder}/${dtsFileName}.d.ts`) | ||
.pipe(fs.createWriteStream(`${destFolder}/${dtsFileName}.d.ts`)); | ||
stream.on("close", resolve); | ||
stream.on("error", reject); | ||
}); | ||
} | ||
|
||
function RemoveTempFolder() { | ||
return exec(`rm -rf ${tempFolder}`); | ||
} | ||
|
||
BuildDeclarationFiles() | ||
.then(Bundle) | ||
.then(CopyDtsInFolder) | ||
.then(RemoveTempFolder); |
Oops, something went wrong.