This file contains hidden or 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
// db-setup.js | |
const path = require('path') | |
const fs = require('fs') | |
const { MongoMemoryServer } = require('mongodb-memory-server') | |
const driver = require('../../src/store/driver') | |
const initializeDb = require('../initialize-db') | |
const globalConfigPath = path.join(__dirname, 'globalConfig.json') | |
const mongod = new MongoMemoryServer({ |
This file contains hidden or 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
// mongo-environment.js | |
const NodeEnvironment = require('jest-environment-node') | |
const path = require('path') | |
const fs = require('fs') | |
const globalConfigPath = path.join(__dirname, 'globalConfig.json') | |
const log = require('../../src/logger') | |
class MongoEnvironment extends NodeEnvironment { | |
constructor (config) { | |
super(config) |
This file contains hidden or 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
// product.test.js | |
const axios = require('axios') | |
const driver = require('../src/store/driver') | |
const httpSetup = require('./setup/http-setup') | |
const log = require('../src/logger') | |
let listener | |
beforeAll(async function () { | |
await driver.connect(global.__MONGO_URI__) |
This file contains hidden or 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
// http-setup.js | |
const axios = require('axios') | |
const app = require('../../src/server') | |
const log = require('../../src/logger').child(module) | |
module.exports = async function httpSetup () { | |
log.info('HTTP test setup initiated') | |
const listener = app.listen() | |
const port = listener.address().port | |
const baseURL = `http://localhost:${port}/api` |
This file contains hidden or 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
// global-teardown.js | |
module.exports = async function () { | |
await global.__MONGOD__.stop() | |
} |
This file contains hidden or 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
$logPath = 'D:\Temp\github-ping.log' | |
$title = "Script started at " + (Get-Date) | |
Set-Content -Value $title -Path $logPath | |
Write-Host -Object $title | |
$ip = 'Error' | |
$logIt = $false | |
$count = 0 | |
$result = $null | |
$newResult = $null | |
$newIp = $null |
OlderNewer