Skip to content

Commit

Permalink
feat: add job js
Browse files Browse the repository at this point in the history
  • Loading branch information
junha-ahn committed Oct 18, 2023
1 parent e3850a9 commit 35ecc1b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/job.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const config = require('./config')
const Logger = $require('loaders/logger')

async function start() {
await $require('loaders')()

Logger.info(`
🛡️ Job Started 🛡️
`)

module.exports = app
}

start()
31 changes: 31 additions & 0 deletions test/integrationTest/job/job.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
const chai = require('chai')
const chaiHttp = require('chai-http')
const { GenericContainer } = require('testcontainers')
const expect = chai.expect
chai.use(chaiHttp)

describe('Ticket', () => {
let server = null
let redis = null
let ticketStoreService = null

beforeAll(async () => {
container = await new GenericContainer('redis')
.withExposedPorts(6379)
.start()
process.env = {
NODE_ENV: 'test',
REDIS_HOST: container.getHost(),
REDIS_PORT: container.getMappedPort(6379),
}

server = require('../../../src/api')
redis = $require('loaders/redis')
const TicketStoreService = $require('services/ticketStore')
ticketStoreService = new TicketStoreService(redis)
})

beforeEach(async () => {
await redis.flushAll()
})
})

0 comments on commit 35ecc1b

Please sign in to comment.