Heat the oven to 400 °F and line a baking sheet with parchment paper.
Pulse the mushrooms in a food processor until finely chopped (or chop by hand). Heat the olive oil in a large skillet over medium-high heat, add the onion and cook 4 minutes, then add the mushrooms and cook 8 to 10 minutes more, until the liquid has cooked off and the mixture is dry. Stir in the garlic, thyme, salt and pepper and cook 1 minute.
Add the spinach to the skillet and stir 2 minutes, until wilted. Take the pan off the heat, stir in the Dijon mustard, then spread the filling on a plate and let it cool 10 minutes.
Unfold the pastry on a sheet of parchment and cut it into two rectangles about 9 by 6 inches. Spoon half the cooled filling down the center of each rectangle, leaving a 1-inch border, then fold the long sides over the filling and pinch the seams closed. Turn seam-side down and tuck the ends under.
Brush the tops with beaten egg and cut three shallow slashes in each. Bake 35 to 40 minutes, until puffed and deep golden brown.
Rest 5 minutes on the baking sheet before slicing with a serrated knife.