Skip to content

Commit

Permalink
feat: test listing region names
Browse files Browse the repository at this point in the history
  • Loading branch information
ciatph committed Sep 1, 2024
1 parent 9339c37 commit 19e181a
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/__tests__/classInitialization/customSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const REMOTE_SOURCE = {
describe('Class intialization using CUSTOM config', () => {
beforeAll(async () => {
await Promise.all([
REMOTE_SOURCE.excelFile.init(false),
REMOTE_SOURCE.excelFactory.init(false)
REMOTE_SOURCE.excelFile.init(),
REMOTE_SOURCE.excelFactory.init()
])
})

Expand Down
19 changes: 19 additions & 0 deletions app/__tests__/regions/regionsTest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require('dotenv').config()
const path = require('path')

const ExcelFile = require('../../src/classes/excel')

/* eslint-disable no-undef */
describe('Regions listing test', () => {
it('should list region names from config file', () => {
const excelFile = new ExcelFile({
pathToFile: path.join(__dirname, '..', '..', 'data', 'day1.xlsx')
})

const regions = excelFile.listRegions()
console.table(regions)

expect(regions).toBeDefined()
expect(Array.isArray(regions)).toBe(true)
})
})
11 changes: 11 additions & 0 deletions app/src/classes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const ColorLog = require('./colorlog')
const ExcelFile = require('./excel')
const ExcelFactory = require('./excelfactory')
const Schema = require('./schema')

module.exports = {
ColorLog,
ExcelFile,
ExcelFactory,
Schema
}

0 comments on commit 19e181a

Please sign in to comment.