Repository: lingui/js-lingui
Pull request #867 (2020-11-15 01:02:59)

chore: Verdaccio testing
Here it is 🍰 

- An example with a forced failing test: https://github.com/lingui/js-lingui/runs/1401346525?check_suite_focus=true (changed the test to fail) 🔴 
- I fix the test: [`639b632` (#867)](https://github.com/lingui/js-lingui/pull/867/commits/639b6328dc75f3489158d550530ae9ef7abddc48) 🛌🏻 
- And.. the release workflow test...:  https://github.com/lingui/js-lingui/runs/1401351821 🟢 

We can run it on each pull request because it's pretty fast and we ensure any user breaks the release step. 👍🏻 


Patch:
diff --git a/.github/verdaccio/config.yaml b/.github/verdaccio/config.yaml
new file mode 100644
index 00000000..e9586487
--- /dev/null
+++ b/.github/verdaccio/config.yaml
@@ -0,0 +1,23 @@
+auth:
+  auth-memory:
+    users:
+      foo:
+        name: test
+        password: test
+store:
+  memory:
+    limit: 1000
+## we don't need any remote request
+uplinks:
+packages:
+  '@*/*':
+    access: $all
+    publish: $all
+  '**':
+    access: $all
+    publish: $all
+middlewares:
+  audit:
+    enabled: true
+logs:
+ - {type: stdout, format: pretty, level: trace}
\ No newline at end of file
diff --git a/README.md b/README.md
index 74f70071..6a83179c 100644
--- a/README.md
+++ b/README.md
@@ -5,8 +5,8 @@
 
 <hr />
 
-[![CircleCI][Badge-CI]][CI]
-[![AppVeyor][Badge-AppVeyor]][AppVeyor]
+![Main Suite][Badge-MainSuite-GithubCI]
+![Release Workflow Testing][Badge-ReleaseWorkflowTesting-GithubCI]
 [![Code Coverage][Badge-Coverage]][Coverage]
 [![PRs Welcome][Badge-PRWelcome]][PRWelcome]
 [![Backers on Open Collective][Badge-ocbackers]][ocbackers-local]
@@ -157,6 +157,8 @@ The project is licensed under the [MIT][License] license.
 [TutorialSetupReact]: https://lingui.js.org/tutorials/setup-react.html
 [RefCLI]: https://lingui.js.org/ref/cli.html
 
+[Badge-MainSuite-GithubCI]: https://github.com/lingui/js-lingui/workflows/main-suite/badge.svg
+[Badge-ReleaseWorkflowTesting-GithubCI]: https://github.com/lingui/js-lingui/workflows/release-workflow-test/badge.svg
 [Badge-CI]: https://img.shields.io/circleci/project/github/lingui/js-lingui/main.svg
 [Badge-AppVeyor]: https://ci.appveyor.com/api/projects/status/0wjdm3qofrjo2c4n/branch/main?svg=true
 [Badge-Coverage]: https://img.shields.io/codecov/c/github/lingui/js-lingui/main.svg
diff --git a/docs/releases/migration-3.rst b/docs/releases/migration-3.rst
index 7e3bc621..fcb7ae8b 100644
--- a/docs/releases/migration-3.rst
+++ b/docs/releases/migration-3.rst
@@ -282,8 +282,3 @@ New features
 
 Event ``change`` is fired anytime new catalogs are loaded or when locale
 is activated.
-
-`Native TypeScript support`
---------------------------
-
-Lingui now supports TypeScript out of the box, don't forget to remove the `@types/lingui` packages from your project. 
diff --git a/examples/create-react-app/src/App.tsx b/examples/create-react-app/src/App.tsx
index 3f886bc5..bc73f587 100644
--- a/examples/create-react-app/src/App.tsx
+++ b/examples/create-react-app/src/App.tsx
@@ -11,7 +11,7 @@ function App() {
     <div className="App">
       <header className="App-header">
         <img className="App-logo" src="https://avatars3.githubusercontent.com/u/11225539?s=200&v=4" /> 
-        <h3><Trans>Language switcher example: </Trans></h3>
+        <h3 data-testid="h3-title"><Trans>Language switcher example: </Trans></h3>
         <div className="lang-container">
           {Object.values(locales).map((locale, index) => (
             <button type="button" onClick={() => dynamicActivate(Object.keys(locales)[index])} key={locale}>
diff --git a/packages/macro/src/macroJs.ts b/packages/macro/src/macroJs.ts
index 1640a9ee..e57207db 100644
--- a/packages/macro/src/macroJs.ts
+++ b/packages/macro/src/macroJs.ts
@@ -193,12 +193,7 @@ export default class MacroJs {
 
     // if there's `message` property, replace macros with formatted message
     const node = descriptor.properties[messageIndex]
-
-    // Inside message descriptor the `t` macro in `message` prop is optional.
-    // Template strings are always processed as if they were wrapped by `t`.
-    const tokens = this.types.isTemplateLiteral(node.value)
-      ? this.tokenizeTemplateLiteral(node.value)
-      : this.tokenizeNode(node.value, true)
+    const tokens = this.tokenizeNode(node.value, true)
 
     let messageNode = node.value
     if (tokens != null) {
@@ -356,6 +351,7 @@ export default class MacroJs {
     }
   }
 
+
   /**
    * Custom matchers
    */
diff --git a/scripts/integration.js b/scripts/integration.js
deleted file mode 100644
index a1b11ee6..00000000
--- a/scripts/integration.js
+++ /dev/null
@@ -1,33 +0,0 @@
-const fs = require("fs")
-const path = require("path")
-const { execSync } = require("child_process")
-
-const BUILD_DIR = path.resolve("packages/")
-const EXAMPLES_DIR = path.resolve("examples")
-
-function listDirs(dir) {
-  return fs
-    .readdirSync(dir)
-    .filter(dirname => fs.lstatSync(path.join(dir, dirname)).isDirectory())
-}
-
-function linkDependencies(example) {
-  console.log("Linking " + example)
-  const dependencies = packages.map(name => `@lingui/${name}`).join(" ")
-  execSync("yalc link " + dependencies, {
-    cwd: path.join(EXAMPLES_DIR, example)
-  })
-  execSync("chmod +x ./node_modules/.bin/lingui", {
-    cwd: path.join(EXAMPLES_DIR, example)
-  })
-}
-
-function linkPackage(packageName) {
-  execSync("yalc publish", { cwd: path.join(BUILD_DIR, packageName, "build") })
-}
-
-const packages = listDirs(BUILD_DIR)
-const examples = listDirs(EXAMPLES_DIR)
-
-packages.forEach(linkPackage)
-examples.forEach(linkDependencies)
diff --git a/scripts/release.js b/scripts/release.js
deleted file mode 100644
index b7660829..00000000
--- a/scripts/release.js
+++ /dev/null
@@ -1,348 +0,0 @@
-const argv = require("minimist")(process.argv.slice(2))
-
-const { exec: _exec } = require("child_process")
-const fs = require("fs-extra")
-const path = require("path")
-const inquirer = require("inquirer")
-const chalk = require("chalk")
-const ora = require("ora")
-const semver = require("semver")
-const R = require("ramda")
-
-const BUILD_DIR = "build/"
-const PACKAGES_DIR = "packages/build"
-
-const npmTagForBranch = {
-  main: "latest",
-  next: "next",
-}
-
-async function devRelease() {
-  // Get the next version
-  const { currentVersion, newVersion } = await getNewVersion("next")
-
-  const spinner = ora({
-    text: "Building packages",
-  })
-  spinner.start()
-  await exec("yarn release:build")
-
-  // Set correct version in package.json for all packages
-  await preparePackageVersions(newVersion)
-
-  // Throw away build stats
-  await exec("git checkout -- scripts/build/results.json")
-  await exec(
-    `npm-cli-login -u username -p password -e email@example.com -r http://0.0.0.0:4873`
-  )
-
-  spinner.text = "Publishing packages"
-  await Promise.all(
-    getPackages().map((packagePath) => {
-      return exec(`npm publish --registry http://0.0.0.0:4873 --tag next`, {
-        cwd: packagePath,
-      })
-    })
-  )
-  spinner.succeed()
-
-  console.log()
-  console.log(
-    `Done! Run ${chalk.yellow(
-      "npm install --registry http://0.0.0.0:4873 @lingui/[package]"
-    )} in target project to install development version of package.`
-  )
-}
-
-async function release() {
-  // Check branch: only `main` and `next` branches are allowed to publish releases
-  const { stdout: branch } = await exec(
-    "git branch | grep \\* | cut -d ' ' -f2"
-  )
-  const npmTag = npmTagForBranch[branch]
-  if (npmTag === undefined)
-    console.error(`Release from branch ${branch} isn't supported`)
-
-  // Get the next version
-  const { currentVersion, newVersion } = await getNewVersion(npmTag)
-
-  // Check if build dir exists
-  let build = false
-  if (fs.existsSync(BUILD_DIR)) {
-    const { confirmRebuild } = await inquirer.prompt({
-      type: "confirm",
-      name: "confirmRebuild",
-      message:
-        "Build directory already exists. Do you want to rebuild all packages?",
-      default: true,
-    })
-    build = confirmRebuild
-  }
-
-  if (build) {
-    await exec("yarn release:build")
-  }
-
-  // Set correct version in package.json for all packages
-  await preparePackageVersions(newVersion)
-
-  // Don't commit package size stats for pre-releases
-  if (npmTag !== "latest") {
-    await exec("git checkout -- scripts/build/results.json")
-  }
-
-  console.log()
-  console.log(chalk.bold("Summary"))
-  console.log(chalk.bold("======="))
-  console.log()
-  console.log(`Branch:  ${chalk.yellow(branch)}`)
-  console.log(`NPM tag: ${chalk.yellow(npmTag)}`)
-  console.log(
-    `Version: ${
-      currentVersion !== newVersion ? `${currentVersion} →` : ""
-    } ${chalk.yellow(newVersion)}`
-  )
-  console.log()
-
-  const { confirmGit } = await inquirer.prompt({
-    type: "confirm",
-    name: "confirmGit",
-    message: "Do you want to proceed, commit version and create git tag?",
-    default: false,
-  })
-  if (!confirmGit) return
-
-  await exec("git add package.json scripts/build/results.json")
-  try {
-    await exec(`git commit -m "chore: release v${newVersion}"`)
-  } catch (e) {
-    console.warn("Nothing to commit, moving on.")
-  }
-  try {
-    await exec(`git tag v${newVersion}`)
-  } catch (e) {
-    console.warn("Tag already exists, moving it to HEAD.")
-    await exec(`git tag -d v${newVersion}`)
-    await exec(`git tag v${newVersion}`)
-  }
-
-  const { otp, proceed } = await inquirer.prompt([
-    {
-      type: "input",
-      name: "otp",
-      message: "Please enter 6-digit OTP token:",
-      validate(value) {
-        try {
-          parseInt(value, 10)
-        } catch (e) {
-          return false
-        }
-        return value.length === 6
-      },
-    },
-    {
-      type: "expand",
-      name: "proceed",
-      message: "Proceed to publish packages to NPM?",
-      choices: [
-        {
-          key: "y",
-          name: "Yes",
-          value: true,
-        },
-        {
-          key: "n",
-          name: "No",
-          value: false,
-        },
-        {
-          key: "d",
-          name: "Dry run",
-          value: "dry",
-        },
-      ],
-    },
-  ])
-  if (!otp || !proceed) return
-
-  await npmPublish(newVersion, {
-    dryRun: proceed === "dry",
-    otp,
-    next: npmTag !== "latest",
-  })
-}
-
-async function getNewVersion(npmTag) {
-  const { version: currentVersion } = await fs.readJson("package.json")
-  const preview = (inc) => semver.inc(currentVersion, inc)
-
-  let { versionInc } = await inquirer.prompt({
-    type: "list",
-    name: "versionInc",
-    message: "What version you want to release?",
-    default: 1,
-    choices: [
-      {
-        value: "current",
-        name: `current ${currentVersion}`,
-      },
-      ...(npmTag === "latest"
-        ? ["patch", "minor", "major"]
-        : ["prerelease", "prepatch", "preminor", "premajor"]
-      ).map((value) => ({
-        value,
-        name: `${value} ${preview(value)}`,
-      })),
-      "manual",
-    ],
-  })
-
-  if (versionInc === "current") {
-    return {
-      currentVersion,
-      newVersion: currentVersion,
-    }
-  } else if (versionInc === "manual") {
-    const { manualVersion } = await inquirer.prompt({
-      type: "input",
-      name: "manualVersion",
-      message: "Enter valid semver version:",
-      validate(value) {
-        return semver.valid(value) !== null
-      },
-    })
-
-    versionInc = manualVersion
-  }
-
-  // Increment version in package.json, but don't commit anything.
-  const { stdout: newVersion } = await exec(
-    `npm --no-git-tag-version version ${versionInc}`
-  )
-  return {
-    currentVersion,
-    newVersion: newVersion.slice(1),
-  }
-}
-
-async function preparePackageVersions(newVersion) {
-  return Promise.all(
-    getPackages().map((packagePath) => preparePackage(newVersion, packagePath))
-  )
-}
-
-async function preparePackage(version, packagePath) {
-  const packageJsonPath = path.join(packagePath, "package.json")
-  const packageJson = await fs.readJson(packageJsonPath)
-
-  packageJson.version = version
-  packageJson.dependencies = preparePackageDependencies(
-    version,
-    packageJson.dependencies
-  )
-  packageJson.devDependencies = preparePackageDependencies(
-    version,
-    packageJson.devDependencies
-  )
-
-  await fs.writeJson(packageJsonPath, packageJson, { spaces: 2 })
-}
-
-function preparePackageDependencies(version, dependencies) {
-  if (!dependencies) return
-
-  const updatedDependencies = {}
-
-  Object.keys(dependencies).forEach((dependency) => {
-    if (dependency.startsWith("@lingui/")) {
-      updatedDependencies[dependency] = version
-    } else {
-      // ignore anything else
-      updatedDependencies[dependency] = dependencies[dependency]
-    }
-  })
-
-  return updatedDependencies
-}
-
-async function npmPublish(version, options) {
-  const results = await Promise.all(
-    getPackages().map(async (packagePath) => {
-      const name = packagePath.split("/").reverse()[0]
-      const spinner = ora({
-        isEnabled: !process.env.CI,
-        text: `Publishing @lingui/${name}@${version}`,
-      })
-
-      spinner.start()
-      try {
-        await npmPublishPackage(packagePath, options)
-      } catch (e) {
-        spinner.fail(`Version ${version} already published!`)
-        console.log(e)
-        return false
-      }
-      spinner.succeed()
-    })
-  )
-
-  if (results.some(R.equals(false))) process.exit(1)
-}
-
-async function npmPublishPackage(packagePath, { otp, next, dryRun }) {
-  const tags = next ? "--tag next" : ""
-  const cmd = `npm publish --access public --otp=${otp} ${tags}`
-
-  if (!dryRun) {
-    await exec(cmd, { cwd: packagePath })
-  } else {
-    console.log(`DRY RUN: ${cmd}`)
-  }
-
-  return true
-}
-
-function getPackages() {
-  return fs
-    .readdirSync(PACKAGES_DIR)
-    .map((directory) => path.join(PACKAGES_DIR, directory))
-    .filter((directory) => fs.lstatSync(directory).isDirectory())
-}
-
-function exec(cmd, options) {
-  const _options = {
-    env: {
-      ...process.env,
-      // When this script is run inside `yarn`, yarn sets thenpm_config_registry
-      // env var to yarn one and the authentication fails.
-      // By overriding it, we force `npm publish` to use npm registry.
-      // https://github.com/yarnpkg/yarn/issues/2935#issuecomment-487020430
-      npm_config_registry: undefined,
-    },
-    ...options,
-  }
-  return new Promise(function (resolve, reject) {
-    _exec(cmd, _options, function (error, stdout, stderr) {
-      stdout = stdout.trim()
-      stderr = stderr.trim()
-
-      if (error === null) {
-        resolve({ stdout, stderr })
-      } else {
-        reject({ error, stdout, stderr })
-      }
-    })
-  })
-}
-
-function main() {
-  if (argv.dev) {
-    return devRelease()
-  } else {
-    return release()
-  }
-}
-
-if (require.main === module) {
-  main().catch((error) => console.error(error))
-}
diff --git a/scripts/verdaccio-integration.js b/scripts/verdaccio-integration.js
new file mode 100644
index 00000000..f8d38f92
--- /dev/null
+++ b/scripts/verdaccio-integration.js
@@ -0,0 +1,52 @@
+const path = require("path")
+const { exec: _exec } = require("child_process")
+const ora = require("ora")
+
+const OPTS = {
+  cwd: path.resolve("examples/create-react-app")
+}
+
+async function main() {
+  const spinner = ora()
+
+  spinner.start("Linking create-react-app")
+  await exec('npm i -g update-by-scope --registry https://registry.npmjs.org', OPTS)
+  await exec('npm config set registry http://0.0.0.0:4873/', OPTS)
+  await exec('update-by-scope @lingui', OPTS)
+  spinner.succeed("Updated @lingui packages")
+
+  spinner.start("Running tests")
+  try {
+    await exec('yarn test --watchAll=false', OPTS)
+    spinner.succeed()
+  } catch (error) {
+    spinner.fail()
+    process.exit(1)
+  }
+}
+
+function exec(cmd, options) {
+  const _options = {
+    env: {
+      ...process.env,
+    },
+    ...options,
+  }
+  return new Promise(function (resolve, reject) {
+    _exec(cmd, _options, function (error, stdout, stderr) {
+      stdout = stdout.trim()
+      stderr = stderr.trim()
+
+      if (error === null) {
+        resolve({ stdout, stderr })
+      } else {
+        reject({ error, stdout, stderr })
+        process.exit(1)
+      }
+    })
+  })
+}
+
+if (require.main === module) {
+  main().catch((error) => console.error(error))
+}
diff --git a/scripts/verdaccio-release.js b/scripts/verdaccio-release.js
new file mode 100644
index 00000000..b9bf11b6
--- /dev/null
+++ b/scripts/verdaccio-release.js
@@ -0,0 +1,75 @@
+const { exec: _exec } = require("child_process")
+const chalk = require("chalk")
+const ora = require("ora")
+
+const LERNA_COMMAND = "./node_modules/.bin/lerna"
+
+async function releaseInVerdaccio() {
+  const spinner = ora()
+
+  // Throw away build stats
+  spinner.start("Logging in Verdaccio")
+  await exec(
+    `npx npm-cli-login -u test -p test -e test@test.com -r http://0.0.0.0:4873`
+  )
+  spinner.succeed()
+
+  spinner.start("Versioning packages")
+  const { stdout: actualBranch } = await exec("git rev-parse --abbrev-ref HEAD")
+  await exec(`${LERNA_COMMAND} version patch --no-git-tag-version --force-publish --no-private --no-push --yes --allow-branch ${actualBranch}`)
+  spinner.succeed()
+
+  spinner.start("Building packages")
+  await exec("yarn release:build")
+  spinner.succeed()
+
+  spinner.start("Dont't mark files as changed to let publish, but not create a git history")
+  await exec("git ls-files -m | xargs git update-index --assume-unchanged");
+  spinner.succeed()
+
+  spinner.start("Publishing packages to local registry")
+  await exec(
+    `${LERNA_COMMAND} publish from-package --force-publish --no-git-tag-version --no-private --no-push --yes --allow-branch ${actualBranch} --contents build --registry="http://0.0.0.0:4873"
+  `)
+  spinner.succeed()
+
+  console.log()
+  console.log(
+    `Done! Run ${chalk.yellow(
+      "npm install --registry http://0.0.0.0:4873 @lingui/[package]"
+    )} in target project to install development version of package.`
+  )
+
+  // we revert the changed files from index
+  await exec("git ls-files -v | grep '^[a-z]' | cut -c3- | xargs git update-index --no-assume-unchanged --");
+}
+
+function exec(cmd, options) {
+  const _options = {
+    env: {
+      ...process.env,
+    },
+    ...options,
+  }
+  return new Promise(function (resolve, reject) {
+    _exec(cmd, _options, function (error, stdout, stderr) {
+      stdout = stdout.trim()
+      stderr = stderr.trim()
+
+      if (error === null) {
+        resolve({ stdout, stderr })
+      } else {
+        reject({ error, stdout, stderr })
+        process.exit(1)
+      }
+    })
+  })
+}
+
+function main() {
+  return releaseInVerdaccio()
+}
+
+if (require.main === module) {
+  main().catch((error) => console.error(error))
+}


Test patch:
diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml
new file mode 100644
index 00000000..ffffc2bf
--- /dev/null
+++ b/.github/workflows/release-test.yml
@@ -0,0 +1,54 @@
+name: release-workflow-test
+
+on:
+  pull_request:
+    branches:
+      - '*'
+  push:
+    branches:
+      - main
+      - next
+
+jobs:
+  release-test:
+    runs-on: ubuntu-latest
+    env:
+      CI: true
+      GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
+    steps:
+      - uses: actions/checkout@v2
+        with:
+          fetch-depth: 0
+
+      - name: Setup node
+        uses: actions/setup-node@v2-beta
+        with:
+          always-auth: true
+          node-version: 14
+          scope: '@lingui'
+
+      - name: Get yarn cache directory path
+        id: yarn-cache-dir-path
+        run: echo "::set-output name=dir::$(yarn cache dir)"
+
+      - uses: actions/cache@v2
+        id: yarn-cache
+        with:
+          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
+          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
+          restore-keys: |
+            ${{ runner.os }}-yarn-
+
+      - name: Install dependencies if needed
+        run: yarn install --frozen-lockfile --pure-lockfile
+
+      - name: Publish with Verdaccio
+        run: |
+          git checkout ${{ github.head_ref }}
+          npm i -g {verdaccio,verdaccio-auth-memory,verdaccio-memory}
+          mkdir -p $HOME/.config/verdaccio
+          cp --verbose .github/verdaccio/config.yaml $HOME/.config/verdaccio/config.yaml
+          nohup verdaccio --config $HOME/.config/verdaccio/config.yaml &>mktemp &
+          node ./scripts/verdaccio-release.js
+          node ./scripts/verdaccio-integration.js
+
diff --git a/examples/create-react-app/src/App.test.tsx b/examples/create-react-app/src/App.test.tsx
index 4db7ebc2..58ba5dea 100644
--- a/examples/create-react-app/src/App.test.tsx
+++ b/examples/create-react-app/src/App.test.tsx
@@ -1,9 +1,42 @@
-import React from 'react';
-import { render } from '@testing-library/react';
-import App from './App';
-
-test('renders learn react link', () => {
-  const { getByText } = render(<App />);
-  const linkElement = getByText(/learn react/i);
-  expect(linkElement).toBeInTheDocument();
+import React from 'react'
+import { getByText, render, act } from '@testing-library/react'
+import { i18n } from '@lingui/core'
+import { I18nProvider } from '@lingui/react'
+import { en, cs } from 'make-plural/plurals'
+
+import { messages } from './locales/en/messages'
+import { messages as csMessages } from './locales/cs/messages'
+import App from './App'
+
+i18n.load({
+  en: messages,
+  cs: csMessages
+})
+i18n.loadLocaleData({
+  en: { plurals: en },
+  cs: { plurals: cs }
+});
+
+const TestingProvider = ({ children }: any) => (
+  <I18nProvider i18n={i18n}>
+    {children}
+  </I18nProvider>
+)
+
+test('Test that lang is translated correctly in English' , () => {
+  act(() => {
+    i18n.activate('en')
+  })
+  const { getByTestId, container } = render(<App />, { wrapper: TestingProvider });
+  expect(getByTestId('h3-title')).toBeInTheDocument()
+  expect(getByText(container, "Language switcher example:")).toBeDefined()
 });
+
+test('Test that lang is translated correctly in Czech', () => {
+  act(() => {
+    i18n.activate('cs')
+  })
+  const { getByTestId, container } = render(<App />, { wrapper: TestingProvider });
+  expect(getByTestId('h3-title')).toBeInTheDocument()
+  expect(getByText(container, "Příklad přepínače jazyků:")).toBeDefined()
+});
\ No newline at end of file
diff --git a/packages/macro/test/js-defineMessage.ts b/packages/macro/test/js-defineMessage.ts
index bf4efa47..d44a7455 100644
--- a/packages/macro/test/js-defineMessage.ts
+++ b/packages/macro/test/js-defineMessage.ts
@@ -36,11 +36,11 @@ export default [
     `,
   },
   {
-    name: "should transform template literals",
+    name: "should left string message intact - template literal",
     input: `
         import { defineMessage } from '@lingui/macro';
         const message = defineMessage({
-          message: \`Message \${name}\`
+          message: \`Message\`
         })
     `,
     expected: `
@@ -48,10 +48,7 @@ export default [
         const message =
           /*i18n*/
           {
-            id: "Message {name}",
-            values: {
-              name: name
-            }
+            id: \`Message\`
           };
     `,
   },
diff --git a/packages/macro/test/js-t.ts b/packages/macro/test/js-t.ts
index b1bf7666..4f41b649 100644
--- a/packages/macro/test/js-t.ts
+++ b/packages/macro/test/js-t.ts
@@ -82,23 +82,6 @@ export default [
         i18n._("Multiline\\nstring")
       `,
   },
-  {
-    name: "Support template strings in t macro message",
-    input: `
-        import { t } from '@lingui/macro'
-        const msg = t({ message: \`Hello \${name}\` })
-      `,
-    expected: `import { i18n } from "@lingui/core";
-    const msg =
-      i18n._(/*i18n*/
-        {
-          id: "Hello {name}",
-          values: {
-            name: name,
-          },
-        });
-      `,
-  },
   {
     name: "Support id and comment in t macro as callExpression",
     input: `