forked from adamlaska/browser-compat-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-migrations.js
More file actions
41 lines (35 loc) · 949 Bytes
/
test-migrations.js
File metadata and controls
41 lines (35 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env node
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
'use strict';
const fs = require('fs');
const path = require('path');
const chalk = require('chalk');
const m002 = require('../scripts/migrations/002-remove-webview-flags.test.js');
/**
* @returns {boolean} If the migrations aren't functioning properly
*/
const testMigrations = () => {
/** @type {string[]} */
const errors = [];
const logger = {
/** @param {...unknown} message */
error: (...message) => {
errors.push(message.join(' '));
},
};
m002(logger);
if (errors.length) {
console.error(
chalk`{red Migrations – {bold ${errors.length}} ${
errors.length === 1 ? 'error' : 'errors'
}:}`,
);
for (let i in errors) {
console.error(chalk`{red ${errors[i]}}`);
}
return true;
}
return false;
};
module.exports = testMigrations;