Skip to content

Commit

Permalink
change lineNumberStart type and replace quotes on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jefferson Carvalho committed Jul 10, 2023
1 parent 68e2338 commit 4980c99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/js/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as ts from 'typescript';
import { Parser, IAddMessageCallback, IParseOptions } from '../parser';
import { IMessage } from '../builder';

export type IJsExtractorFunction = (node: ts.Node, sourceFile: ts.SourceFile, addMessage: IAddMessageCallback, lineNumberStart?: number) => void;
export type IJsExtractorFunction = (node: ts.Node, sourceFile: ts.SourceFile, addMessage: IAddMessageCallback, lineNumberStart: number) => void;

export interface IJsParseOptions extends IParseOptions {
scriptKind?: ts.ScriptKind;
Expand Down
8 changes: 4 additions & 4 deletions tests/js/extractors/factories/htmlTemplate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ describe('JS: HTML template extractor', () => {
});

test('single line (regular string)', () => {
jsParser.parseString("let itBe = \"<div> <translate> test </translate> </div>\"");
jsParser.parseString('let itBe = "<div> <translate> test </translate> </div>"');
expect(messages).toEqual([
{
text: 'test'
Expand All @@ -39,7 +39,7 @@ describe('JS: HTML template extractor', () => {
});

test('single line (template string)', () => {
jsParser.parseString("let itBe = \"<div> <translate> test </translate> </div>\"");
jsParser.parseString('let itBe = "<div> <translate> test </translate> </div>"');
expect(messages).toEqual([
{
text: 'test'
Expand All @@ -49,7 +49,7 @@ describe('JS: HTML template extractor', () => {

test('with lineNumberStart option (regular string)', () => {
jsParser.parseString(
"let itBe = \"<div> <translate> test </translate> </div>\"",
'let itBe = "<div> <translate> test </translate> </div>"',
'test',
{ lineNumberStart: 10 }
);
Expand All @@ -64,7 +64,7 @@ describe('JS: HTML template extractor', () => {

test('with lineNumberStart option (template string)', () => {
jsParser.parseString(
`let itBe = \"<div> <translate> test </translate> </div>\"`,
'let itBe = "<div> <translate> test </translate> </div>"',
'test',
{ lineNumberStart: 10 }
);
Expand Down

0 comments on commit 4980c99

Please sign in to comment.