Files
flights_web_raw/ClientApp/node_modules/getos/tests/mocktests.js
T
gnezim 0a5ab058a6 Initial commit: Aeroflot Flights Web - Angular 12 baseline
- Angular 12 application with PrimeNG components
- 5 existing Cypress e2e test suites
- SCSS styling with BEM naming convention
- i18n support (10 languages)
- Leaflet map integration
- Complete component hierarchy and routing structure

This baseline will be used for Angular → React migration.
2026-04-05 18:47:57 +03:00

41 lines
971 B
JavaScript

var test = require('tape')
var fs = require('fs')
var os = require('os')
var mockdata = require('./mockdata')
var currentData
os.platform = function () {
return currentData.platform
}
fs.stat = function (file, callback) {
process.nextTick(function () {
if (!currentData.file[file]) { return callback(new Error()) }
callback(null, { isFile: function () { return true } })
})
}
fs.readFile = function (file, enc, callback) {
process.nextTick(function () {
if (!currentData.file[file]) { return callback(new Error()) }
callback(null, currentData.file[file])
})
}
mockdata.forEach(function (data) {
test('test ' + data.desc, function (t) {
// reload each time to avoid internal caching
delete require.cache[require.resolve('../')]
var getos = require('../')
currentData = data
getos(function (err, os) {
t.error(err, 'no error')
t.deepEqual(os, data.expected, 'correct os data')
t.end()
})
})
})