Skip to content

Commit

Permalink
path updates
Browse files Browse the repository at this point in the history
- as suggested by @johnhooks to set as source for tests the "src" folder (and not the builded one)
- updated node internal modules paths prefix (ref. https://nodejs.org/api/module.html#modules-nodemodule-api)
  • Loading branch information
erikyo committed May 4, 2024
1 parent f6f0022 commit 2c2e5e5
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 35 deletions.
10 changes: 5 additions & 5 deletions test/mo-compiler-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { promisify } from 'node:util';
import path from 'node:path';
import { mo } from '../src/index.js';
import { readFile as fsReadFile } from 'node:fs';
import { fileURLToPath } from 'node:url';
import * as chai from 'chai';
import { promisify } from 'util';
import path from 'path';
import { mo } from '../lib/index.js';
import { readFile as fsReadFile } from 'fs';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down
10 changes: 5 additions & 5 deletions test/mo-parser-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { promisify } from 'node:util';
import path from 'node:path';
import { readFile as fsReadFile } from 'node:fs';
import { fileURLToPath } from 'node:url';
import * as chai from 'chai';
import { promisify } from 'util';
import path from 'path';
import { mo } from '../lib/index.js';
import { readFile as fsReadFile } from 'fs';
import { fileURLToPath } from 'url';
import { mo } from '../src/index.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down
2 changes: 1 addition & 1 deletion test/module.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'chai';
import { po, mo } from '../lib/index.js';
import { po, mo } from '../src/index.js';

describe('esm module', () => {
it('should allow named imports', () => {
Expand Down
12 changes: 6 additions & 6 deletions test/po-compiler-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { EOL } from 'os';
import { promisify } from 'util';
import path from 'path';
import { readFile as fsReadFile } from 'fs';
import { readFile as fsReadFile } from 'node:fs';
import { promisify } from 'node:util';
import path from 'node:path';
import { EOL } from 'node:os';
import { fileURLToPath } from 'node:url';
import { po } from '../src/index.js';
import * as chai from 'chai';
import { po } from '../lib/index.js';
import { fileURLToPath } from 'url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down
12 changes: 6 additions & 6 deletions test/po-obsolete-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { EOL } from 'os';
import { EOL } from 'node:os';
import path from 'node:path';
import fs from 'node:fs';
import { promisify } from 'node:util';
import * as chai from 'chai';
import { promisify } from 'util';
import path from 'path';
import fs from 'fs';
import * as gettextParser from '../lib/index.js';
import { fileURLToPath } from 'url';
import * as gettextParser from '../src/index.js';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down
10 changes: 5 additions & 5 deletions test/po-parser-test.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as chai from 'chai';
import { promisify } from 'util';
import path from 'path';
import fs from 'fs';
import * as gettextParser from '../lib/index.js';
import { fileURLToPath } from 'url';
import { promisify } from 'node:util';
import path from 'node:path';
import fs from 'node:fs';
import * as gettextParser from '../src/index.js';
import { fileURLToPath } from 'node:url';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down
12 changes: 5 additions & 7 deletions test/shared.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
'use strict';

import { promisify } from 'node:util';
import path from 'node:path';
import { readFile as fsReadFile } from 'node:fs';
import { fileURLToPath } from 'node:url';
import * as chai from 'chai';
import { promisify } from 'util';
import path from 'path';
import { formatCharset, parseHeader, generateHeader, foldLine, parseNPluralFromHeadersSafely } from '../lib/shared.js';
import { readFile as fsReadFile } from 'fs';
import { fileURLToPath } from 'url';
import { formatCharset, parseHeader, generateHeader, foldLine, parseNPluralFromHeadersSafely } from '../src/shared.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
Expand Down

0 comments on commit 2c2e5e5

Please sign in to comment.